diff options
author | Marcel Hibbe <dev@mhibbe.de> | 2022-04-08 15:56:18 +0300 |
---|---|---|
committer | Marcel Hibbe <dev@mhibbe.de> | 2022-04-08 15:56:18 +0300 |
commit | 54c40e99efd326e598877626b6e551045e8e30d3 (patch) | |
tree | 44e41f63620ad49f9d195eee664f3946aa4a5431 | |
parent | 0b1f7cb7834820523fd2fedb5a226c6baf7795b6 (diff) |
hide amount in message if it's only 1
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
-rw-r--r-- | app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt index 6788e5559..5c1c11753 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt @@ -49,13 +49,16 @@ class Reaction { for ((emoji, amount) in message.reactions) { val reactionEmoji = EmojiTextView(context) reactionEmoji.text = emoji + binding.reactionsEmojiWrapper.addView(reactionEmoji) val reactionAmount = TextView(context) - if (useLightColorForText){ - reactionAmount.setTextColor(ContextCompat.getColor(context, R.color.nc_grey)) - } - reactionAmount.text = amount.toString() + if (amount > 1) { + if (useLightColorForText) { + reactionAmount.setTextColor(ContextCompat.getColor(context, R.color.nc_grey)) + } + reactionAmount.text = amount.toString() + } val params = RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, @@ -68,10 +71,9 @@ class Reaction { 0 ) reactionAmount.layoutParams = params - - binding.reactionsEmojiWrapper.addView(reactionEmoji) binding.reactionsEmojiWrapper.addView(reactionAmount) + remainingEmojisToDisplay-- if (remainingEmojisToDisplay == 0 && showInfoAboutMoreEmojis) { val infoAboutMoreEmojis = TextView(context) |