Skip to content

Commit

Permalink
Updated layout and colors.
Browse files Browse the repository at this point in the history
  • Loading branch information
khaykov committed Nov 20, 2020
1 parent e046069 commit 94b7de5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ class ReaderPostViewHolder(
)
}

uiHelpers.updateVisibility(authors_avatar, state.blogSection.isAuthorAvatarVisible)
if (state.blogSection.authorAvatarUrl == null) {
val canShowAuthorsAvatar = state.blogSection.authorAvatarUrl != null && state.blogSection.isAuthorAvatarVisible
uiHelpers.updateVisibility(authors_avatar, canShowAuthorsAvatar)

if (!canShowAuthorsAvatar) {
imageManager.cancelRequestAndClearImageView(authors_avatar)
} else {
imageManager.loadIntoCircle(authors_avatar, BLAVATAR_CIRCULAR, state.blogSection.authorAvatarUrl)
imageManager.loadIntoCircle(authors_avatar, BLAVATAR_CIRCULAR, state.blogSection.authorAvatarUrl!!)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:width="1dp"
android:color="@color/p2_author_bg_stroke"/>
</shape>
20 changes: 16 additions & 4 deletions WordPress/src/main/res/layout/reader_blog_section_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">

<FrameLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginEnd="@dimen/margin_medium"
android:id="@+id/author_and_site_imagery_container"
android:layout_width="wrap_content"
Expand All @@ -21,17 +21,29 @@
android:background="@drawable/bg_oval_stroke_placeholder_1dp"
android:importantForAccessibility="no"
android:padding="@dimen/reader_image_avatar_or_blavatar_border_width"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlSymmetry" />

<ViewStub
android:id="@+id/dynamic_center_point"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="@+id/image_avatar_or_blavatar"
app:layout_constraintLeft_toLeftOf="@+id/image_avatar_or_blavatar"
app:layout_constraintRight_toRightOf="@+id/image_avatar_or_blavatar"
app:layout_constraintTop_toTopOf="@+id/image_avatar_or_blavatar" />

<ImageView
android:id="@+id/authors_avatar"
style="@style/ReaderImageView.Avatar"
android:layout_marginStart="20dp"
android:background="@drawable/bg_oval_stroke_placeholder_1dp"
android:background="@drawable/bg_oval_stroke_p2_author_1dp"
android:importantForAccessibility="no"
android:padding="@dimen/reader_image_avatar_or_blavatar_border_width"
app:layout_constraintStart_toEndOf="@+id/dynamic_center_point"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlSymmetry" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

<com.google.android.material.textview.MaterialTextView
android:id="@+id/text_author_and_blog_name"
Expand Down
1 change: 1 addition & 0 deletions WordPress/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<!-- Switch to attribute after dropping support for api 21-23 -->
<color name="placeholder">#1AFFFFFF</color>
<color name="p2_author_bg_stroke">#1E1E1E</color>

<!-- Stats -->

Expand Down
1 change: 1 addition & 0 deletions WordPress/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<!-- Switch to attribute after dropping support for api 21-23 -->
<color name="placeholder">#1A000000</color>
<color name="p2_author_bg_stroke">#FFF</color>

<!-- Stats -->

Expand Down

0 comments on commit 94b7de5

Please sign in to comment.