1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 09:08:49 -05:00

Use different background for selected messages in message list

This commit is contained in:
cketti 2013-03-03 22:52:03 +01:00
parent 04e1bf6976
commit 78dc5e5194
3 changed files with 12 additions and 3 deletions

View File

@ -37,6 +37,7 @@
<attr name="textColorPrimaryRecipientDropdown" format="reference" /> <attr name="textColorPrimaryRecipientDropdown" format="reference" />
<attr name="textColorSecondaryRecipientDropdown" format="reference" /> <attr name="textColorSecondaryRecipientDropdown" format="reference" />
<attr name="backgroundColorChooseAccountHeader" format="color" /> <attr name="backgroundColorChooseAccountHeader" format="color" />
<attr name="messageListSelectedBackgroundColor" format="reference|color"/>
<attr name="messageListReadItemBackgroundColor" format="reference|color"/> <attr name="messageListReadItemBackgroundColor" format="reference|color"/>
<attr name="messageListUnreadItemBackgroundColor" format="reference|color"/> <attr name="messageListUnreadItemBackgroundColor" format="reference|color"/>
<attr name="messageListThreadCountForegroundColor" format="reference|color"/> <attr name="messageListThreadCountForegroundColor" format="reference|color"/>

View File

@ -36,6 +36,7 @@
<item name="iconActionRequestReadReceipt">@drawable/ic_action_request_read_receipt_light</item> <item name="iconActionRequestReadReceipt">@drawable/ic_action_request_read_receipt_light</item>
<item name="textColorPrimaryRecipientDropdown">@android:color/primary_text_light</item> <item name="textColorPrimaryRecipientDropdown">@android:color/primary_text_light</item>
<item name="textColorSecondaryRecipientDropdown">@android:color/secondary_text_light</item> <item name="textColorSecondaryRecipientDropdown">@android:color/secondary_text_light</item>
<item name="messageListSelectedBackgroundColor">#8038B8E2</item>
<item name="messageListReadItemBackgroundColor">#80cdcdcd</item> <item name="messageListReadItemBackgroundColor">#80cdcdcd</item>
<item name="messageListUnreadItemBackgroundColor">#00ffffff</item> <item name="messageListUnreadItemBackgroundColor">#00ffffff</item>
<item name="messageListThreadCountForegroundColor">?android:attr/colorBackground</item> <item name="messageListThreadCountForegroundColor">?android:attr/colorBackground</item>
@ -81,6 +82,7 @@
<item name="iconActionRequestReadReceipt">@drawable/ic_action_request_read_receipt_dark</item> <item name="iconActionRequestReadReceipt">@drawable/ic_action_request_read_receipt_dark</item>
<item name="textColorPrimaryRecipientDropdown">@android:color/primary_text_dark</item> <item name="textColorPrimaryRecipientDropdown">@android:color/primary_text_dark</item>
<item name="textColorSecondaryRecipientDropdown">@android:color/secondary_text_dark</item> <item name="textColorSecondaryRecipientDropdown">@android:color/secondary_text_dark</item>
<item name="messageListSelectedBackgroundColor">#8038B8E2</item>
<item name="messageListReadItemBackgroundColor">#00000000</item> <item name="messageListReadItemBackgroundColor">#00000000</item>
<item name="messageListUnreadItemBackgroundColor">#805a5a5a</item> <item name="messageListUnreadItemBackgroundColor">#805a5a5a</item>
<item name="messageListThreadCountForegroundColor">?android:attr/colorBackground</item> <item name="messageListThreadCountForegroundColor">?android:attr/colorBackground</item>

View File

@ -1876,9 +1876,15 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
} }
// Background indicator // Background indicator
if (K9.useBackgroundAsUnreadIndicator()) { if (selected || K9.useBackgroundAsUnreadIndicator()) {
int res = (read) ? R.attr.messageListReadItemBackgroundColor : int res;
R.attr.messageListUnreadItemBackgroundColor; if (selected) {
res = R.attr.messageListSelectedBackgroundColor;
} else if (read) {
res = R.attr.messageListReadItemBackgroundColor;
} else {
res = R.attr.messageListUnreadItemBackgroundColor;
}
TypedValue outValue = new TypedValue(); TypedValue outValue = new TypedValue();
getActivity().getTheme().resolveAttribute(res, outValue, true); getActivity().getTheme().resolveAttribute(res, outValue, true);