Jelajahi Sumber

fix more emojis ("...") color

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 3 tahun lalu
induk
melakukan
b136465415

+ 7 - 8
app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt

@@ -50,6 +50,11 @@ class Reaction {
             var remainingEmojisToDisplay = MAX_EMOJIS_TO_DISPLAY
             val showInfoAboutMoreEmojis = message.reactions.size > MAX_EMOJIS_TO_DISPLAY
 
+            var textColor = ContextCompat.getColor(context, R.color.white)
+            if (!isOutgoingMessage) {
+                textColor = ContextCompat.getColor(binding.root.context,  R.color.high_emphasis_text)
+            }
+
             val amountParams = LinearLayout.LayoutParams(
                 ViewGroup.LayoutParams.WRAP_CONTENT,
                 ViewGroup.LayoutParams.WRAP_CONTENT
@@ -81,13 +86,7 @@ class Reaction {
 
                 if (amount > 1) {
                     val reactionAmount = TextView(context)
-                    if (isOutgoingMessage) {
-                        reactionAmount.setTextColor(ContextCompat.getColor(context, R.color.white))
-                    } else {
-                        reactionAmount.setTextColor(
-                            ContextCompat.getColor(binding.root.context,  R.color.high_emphasis_text)
-                        )
-                    }
+                    reactionAmount.setTextColor(textColor)
                     reactionAmount.text = amount.toString()
                     reactionAmount.layoutParams = amountParams
                     emojiWithAmountWrapper.addView(reactionAmount)
@@ -103,7 +102,7 @@ class Reaction {
                 remainingEmojisToDisplay--
                 if (remainingEmojisToDisplay == 0 && showInfoAboutMoreEmojis) {
                     val infoAboutMoreEmojis = TextView(context)
-                    infoAboutMoreEmojis.setTextColor(ContextCompat.getColor(context, R.color.textColorMaxContrast))
+                    infoAboutMoreEmojis.setTextColor(textColor)
                     infoAboutMoreEmojis.text = EMOJI_MORE
                     binding.reactionsEmojiWrapper.addView(infoAboutMoreEmojis)
                     break