From ca8add78735156b9aa5df93da4d8a4f205c559f5 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Wed, 18 May 2022 11:36:02 +0530 Subject: [PATCH] Fix message bubbles Makes the incoming message bubble follow accent color and also makes the text in it to follow the background of the app so that it is consistent with other elements like floating action button --- .../src/main/java/com/moez/QKSMS/common/util/Colors.kt | 2 +- .../java/com/moez/QKSMS/feature/compose/MessagesAdapter.kt | 2 +- .../moez/QKSMS/feature/conversations/ConversationsAdapter.kt | 3 +-- presentation/src/main/res/values/colors.xml | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/presentation/src/main/java/com/moez/QKSMS/common/util/Colors.kt b/presentation/src/main/java/com/moez/QKSMS/common/util/Colors.kt index 35dfe09c..6893faaf 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/util/Colors.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/util/Colors.kt @@ -82,7 +82,7 @@ class Colors @Inject constructor( val pref = prefs.theme(recipient?.id ?: 0) val color = when { recipient == null || !prefs.autoColor.get() || pref.isSet -> pref.get() - else -> generateColor(recipient) + else -> context.getColor(R.color.tools_theme) } return Theme(color, this) } diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/MessagesAdapter.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/MessagesAdapter.kt index b95d7a9d..e15991f5 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/MessagesAdapter.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/MessagesAdapter.kt @@ -243,7 +243,7 @@ class MessagesAdapter @Inject constructor( holder.avatar.setRecipient(contactCache[message.address]) holder.avatar.setVisible(!canGroup(message, next), View.INVISIBLE) - holder.body.setTextColor(theme.textPrimary) + holder.body.setTextColor(context.resources.getColor(R.color.backgroundDark)) holder.body.setBackgroundTint(theme.theme) } diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/conversations/ConversationsAdapter.kt b/presentation/src/main/java/com/moez/QKSMS/feature/conversations/ConversationsAdapter.kt index 2d791c0f..133468c2 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/conversations/ConversationsAdapter.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/conversations/ConversationsAdapter.kt @@ -68,7 +68,7 @@ class ConversationsAdapter @Inject constructor( view.snippet.maxLines = 5 view.unread.isVisible = true - view.unread.setTint(context.getColor(R.color.tools_theme)) + view.unread.setTint(context.getColor(R.color.unread_dot)) view.date.setTypeface(view.date.typeface, Typeface.BOLD) view.date.setTextColor(textColorPrimary) @@ -122,7 +122,6 @@ class ConversationsAdapter @Inject constructor( else -> conversation.snippet } holder.pinned.isVisible = conversation.pinned - holder.unread.setTint(theme) } override fun getItemId(position: Int): Long { diff --git a/presentation/src/main/res/values/colors.xml b/presentation/src/main/res/values/colors.xml index 33e75264..5b448092 100644 --- a/presentation/src/main/res/values/colors.xml +++ b/presentation/src/main/res/values/colors.xml @@ -335,4 +335,5 @@ #263238 + #44B04C -- GitLab