diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-24 21:39:08 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-24 21:39:08 +0200 |
commit | 3f9d360b15f57f09abc826289ec15195e9a22f17 (patch) | |
tree | a4fd806a707981fa5f8f194f8e88fa89bf0ef39b /src/main | |
parent | 3bfbf315f6264304acaf5a9ade3be48767f5b49f (diff) |
change opacity on emoji only messages
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 4 | ||||
-rw-r--r-- | src/main/res/values/attrs.xml | 1 | ||||
-rw-r--r-- | src/main/res/values/styles.xml | 8 | ||||
-rw-r--r-- | src/main/res/values/themes.xml | 2 |
4 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 2a8aabd8f..707deed2b 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -436,9 +436,9 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie viewHolder.image.setVisibility(View.GONE); viewHolder.messageBody.setVisibility(View.VISIBLE); if (darkBackground) { - viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1_OnDark); + viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1_Emoji_OnDark); } else { - viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1); + viewHolder.messageBody.setTextAppearance(getContext(), R.style.TextAppearance_Conversations_Body1_Emoji); } Spannable span = new SpannableString(body); float size = Emoticons.isEmoji(body) ? 3.0f : 2.0f; diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml index ee89502f2..f6c2e5fed 100644 --- a/src/main/res/values/attrs.xml +++ b/src/main/res/values/attrs.xml @@ -19,6 +19,7 @@ <attr name="color_background_secondary" format="reference|color" /> <attr name="color_background_primary" format="reference|color" /> <attr name="color_warning" format="reference|color" /> + <attr name="EmojiColor" format="reference|color"/> <attr name="ic_send_cancel_offline" format="reference" /> <attr name="ic_send_location_offline" format="reference" /> diff --git a/src/main/res/values/styles.xml b/src/main/res/values/styles.xml index 03ff3a9d6..ea9016211 100644 --- a/src/main/res/values/styles.xml +++ b/src/main/res/values/styles.xml @@ -98,6 +98,14 @@ <item name="android:textColorLink">@color/white</item> </style> + <style name="TextAppearance.Conversations.Body1.Emoji.OnDark" parent="TextAppearance.Conversations.Body1"> + <item name="android:textColor">?EmojiColor</item> + </style> + + <style name="TextAppearance.Conversations.Body1.Emoji" parent="TextAppearance.Conversations.Body1"> + <item name="android:textColor">?EmojiColor</item> + </style> + <style name="TextAppearance.Conversations.Body1.Secondary.OnDark" parent="TextAppearance.Conversations.Body1"> <item name="android:textColor">@color/white70</item> </style> diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index 5bf27cbfd..c656c5ed4 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -13,6 +13,7 @@ <item name="color_background_primary">@color/grey50</item> <item name="color_background_secondary">@color/grey200</item> <item name="color_warning">@color/red_a700</item> + <item name="EmojiColor">@color/realblack</item> <item name="color_bubble_light">@color/lightwhite</item> <item name="color_bubble_blue">@color/lightblue</item> @@ -127,6 +128,7 @@ <item name="color_background_primary">@color/grey900</item> <item name="color_background_secondary">@color/realblack</item> <item name="color_warning">@color/red_a700</item> + <item name="EmojiColor">@color/realwhite</item> <item name="color_bubble_light">@color/darkwhite</item> <item name="color_bubble_blue">@color/darkblue</item> |