mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
hide amount in message if it's only 1
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
0b1f7cb783
commit
54c40e99ef
@ -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 (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)
|
||||
|
Loading…
Reference in New Issue
Block a user