Emoji reactions: improved dialog UI & fixed count
This commit is contained in:
parent
8249f2c3a6
commit
f748424943
3 changed files with 7 additions and 6 deletions
|
@ -75,11 +75,12 @@ class ChatMessageReactionsListData(private val chatMessage: ChatMessage) {
|
||||||
for (reaction in chatMessage.reactions) {
|
for (reaction in chatMessage.reactions) {
|
||||||
val body = reaction.body
|
val body = reaction.body
|
||||||
val count = if (reactionsMap.containsKey(body)) {
|
val count = if (reactionsMap.containsKey(body)) {
|
||||||
reactionsMap[body] ?: 1
|
reactionsMap[body] ?: 0
|
||||||
} else {
|
} else {
|
||||||
1
|
0
|
||||||
}
|
}
|
||||||
reactionsMap[body] = count
|
// getOrDefault isn't available for API 23 :'(
|
||||||
|
reactionsMap[body] = count + 1
|
||||||
reactionsList.add(reaction)
|
reactionsList.add(reaction)
|
||||||
}
|
}
|
||||||
reactions.value = reactionsList
|
reactions.value = reactionsList
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="55dp"
|
||||||
android:padding="10dp">
|
android:padding="10dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|
|
@ -33,12 +33,12 @@
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:layout_marginEnd="2dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:background="?dividerColor" />
|
android:background="?dividerColor" />
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="220dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in a new issue