Skip to content

Commit

Permalink
Merge pull request #7862 from thunderbird/fix-message-list-item-style
Browse files Browse the repository at this point in the history
Fix message list item style
  • Loading branch information
wmontwe committed May 22, 2024
2 parents 6e24ca9 + abc1731 commit b91b356
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ class MessageListAdapter internal constructor(
alphaFractionAttrId = R.attr.messageListActiveItemBackgroundAlphaFraction,
backgroundColorAttrId = R.attr.messageListActiveItemBackgroundAlphaBackground,
)
private val selectedItemBackgroundColor: Int = theme.resolveColorAttribute(
colorAttrId = R.attr.messageListSelectedBackgroundColor,
alphaFractionAttrId = R.attr.messageListSelectedBackgroundAlphaFraction,
backgroundColorAttrId = R.attr.messageListSelectedBackgroundAlphaBackground,
)
private val selectedItemBackgroundColor: Int =
theme.resolveColorAttribute(com.google.android.material.R.attr.colorSurfaceContainerHigh)
private val regularItemBackgroundColor: Int =
theme.resolveColorAttribute(R.attr.messageListRegularItemBackgroundColor)
private val readItemBackgroundColor: Int = theme.resolveColorAttribute(R.attr.messageListReadItemBackgroundColor)
Expand Down Expand Up @@ -485,7 +482,7 @@ class MessageListAdapter internal constructor(
if (displayAddress != null) {
contactsPictureLoader.setContactPicture(contactPictureView, displayAddress)
} else {
contactPictureView.setImageResource(Icons.Outlined.AccountCircle)
contactPictureView.setImageResource(Icons.Outlined.Check)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<solid android:color="?attr/colorPrimary" />
</shape>
7 changes: 5 additions & 2 deletions app/ui/legacy/src/main/res/layout/message_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
android:layout_marginStart="@dimen/messageListHorizontalPadding"
android:layout_marginTop="@dimen/fakeAlignImageTopToTextTopPadding"
android:contentDescription="@null"
android:background="@drawable/message_list_item_selection_background"
android:padding="4dp"
android:visibility="gone"
app:tint="?attr/colorOnPrimary"
app:layout_constraintBottom_toTopOf="@+id/bottom_guideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/top_guideline"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/ic_check_circle" />
app:srcCompat="@drawable/ic_check" />

<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/contact_picture"
Expand All @@ -37,7 +40,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/top_guideline"
app:layout_constraintVertical_bias="0.0"
tools:src="@drawable/ic_account_circle" />
tools:src="@drawable/ic_person" />

<TextView
android:id="@+id/preview"
Expand Down
3 changes: 0 additions & 3 deletions app/ui/legacy/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
<attr name="textColorPrimaryRecipientDropdown" format="reference" />
<attr name="textColorSecondaryRecipientDropdown" format="reference" />
<attr name="backgroundColorChooseAccountHeader" format="color" />
<attr name="messageListSelectedBackgroundColor" format="reference|color"/>
<attr name="messageListSelectedBackgroundAlphaFraction" format="fraction"/>
<attr name="messageListSelectedBackgroundAlphaBackground" format="reference|color"/>
<attr name="messageListRegularItemBackgroundColor" format="reference|color"/>
<attr name="messageListReadItemBackgroundColor" format="reference|color"/>
<attr name="messageListUnreadItemBackgroundColor" format="reference|color"/>
Expand Down
6 changes: 0 additions & 6 deletions app/ui/legacy/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@
<item name="textColorPrimaryRecipientDropdown">@android:color/primary_text_light</item>
<item name="textColorSecondaryRecipientDropdown">@android:color/secondary_text_light</item>

<item name="messageListSelectedBackgroundColor">?attr/colorSecondaryVariant</item>
<item name="messageListSelectedBackgroundAlphaFraction">33%</item>
<item name="messageListSelectedBackgroundAlphaBackground">?attr/colorSurface</item>
<item name="messageListRegularItemBackgroundColor">?android:attr/windowBackground</item>
<item name="messageListReadItemBackgroundColor">#ffd8d8d8</item>
<item name="messageListUnreadItemBackgroundColor">?attr/messageListRegularItemBackgroundColor</item>
Expand Down Expand Up @@ -188,9 +185,6 @@

<item name="textColorPrimaryRecipientDropdown">@android:color/primary_text_dark</item>
<item name="textColorSecondaryRecipientDropdown">@android:color/secondary_text_dark</item>
<item name="messageListSelectedBackgroundColor">?attr/colorSecondaryVariant</item>
<item name="messageListSelectedBackgroundAlphaFraction">25%</item>
<item name="messageListSelectedBackgroundAlphaBackground">?attr/colorSurface</item>
<item name="messageListRegularItemBackgroundColor">?android:attr/windowBackground</item>
<item name="messageListReadItemBackgroundColor">?attr/messageListRegularItemBackgroundColor</item>
<item name="messageListUnreadItemBackgroundColor">#ff505050</item>
Expand Down

0 comments on commit b91b356

Please sign in to comment.