Fixed some color issue with emoji reactions + only display counter if more than one same emoji
This commit is contained in:
parent
ede66c2fa7
commit
4dfc21f4b5
5 changed files with 19 additions and 4 deletions
|
@ -285,14 +285,20 @@ class ChatMessageData(val chatMessage: ChatMessage) : GenericContactData(chatMes
|
||||||
val reactionsList = arrayListOf<String>()
|
val reactionsList = arrayListOf<String>()
|
||||||
val allReactions = chatMessage.reactions
|
val allReactions = chatMessage.reactions
|
||||||
|
|
||||||
|
var sameReactionTwiceOrMore = false
|
||||||
if (allReactions.isNotEmpty()) {
|
if (allReactions.isNotEmpty()) {
|
||||||
for (reaction in allReactions) {
|
for (reaction in allReactions) {
|
||||||
val body = reaction.body
|
val body = reaction.body
|
||||||
if (!reactionsList.contains(body)) {
|
if (!reactionsList.contains(body)) {
|
||||||
reactionsList.add(body)
|
reactionsList.add(body)
|
||||||
|
} else {
|
||||||
|
sameReactionTwiceOrMore = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reactionsList.add(allReactions.size.toString())
|
|
||||||
|
if (sameReactionTwiceOrMore) {
|
||||||
|
reactionsList.add(allReactions.size.toString())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reactions.value = reactionsList
|
reactions.value = reactionsList
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:text="@string/emoji_love"
|
android:text="@string/emoji_love"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
app:layout_constraintEnd_toStartOf="@id/thumbs_up"
|
app:layout_constraintEnd_toStartOf="@id/thumbs_up"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
@ -79,6 +80,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:text="@string/emoji_thumbs_up"
|
android:text="@string/emoji_thumbs_up"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
app:layout_constraintEnd_toStartOf="@id/laughing"
|
app:layout_constraintEnd_toStartOf="@id/laughing"
|
||||||
app:layout_constraintStart_toEndOf="@id/love"
|
app:layout_constraintStart_toEndOf="@id/love"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
@ -92,6 +94,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:text="@string/emoji_laughing"
|
android:text="@string/emoji_laughing"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
app:layout_constraintEnd_toStartOf="@id/surprised"
|
app:layout_constraintEnd_toStartOf="@id/surprised"
|
||||||
app:layout_constraintStart_toEndOf="@id/thumbs_up"
|
app:layout_constraintStart_toEndOf="@id/thumbs_up"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
@ -105,6 +108,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:text="@string/emoji_surprised"
|
android:text="@string/emoji_surprised"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
app:layout_constraintEnd_toStartOf="@id/tear"
|
app:layout_constraintEnd_toStartOf="@id/tear"
|
||||||
app:layout_constraintStart_toEndOf="@id/laughing"
|
app:layout_constraintStart_toEndOf="@id/laughing"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
@ -118,6 +122,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:text="@string/emoji_tear"
|
android:text="@string/emoji_tear"
|
||||||
|
android:textColor="?attr/primaryTextColor"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/surprised"
|
app:layout_constraintStart_toEndOf="@id/surprised"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
android:textSize="@{data.matches(`\\d+`) ? @dimen/chat_message_emoji_reactions_count_font_size : @dimen/chat_message_emoji_reaction_font_size, default=@dimen/chat_message_emoji_reaction_font_size}"
|
android:textSize="@{data.matches(`\\d+`) ? @dimen/chat_message_emoji_reactions_count_font_size : @dimen/chat_message_emoji_reaction_font_size, default=@dimen/chat_message_emoji_reaction_font_size}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/dark_grey_color"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:layout_marginEnd="2dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:text="@{data, default=@string/emoji_love}"/>
|
android:text="@{data, default=@string/emoji_love}"/>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<layout
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
@ -25,8 +25,10 @@
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/tabs"
|
android:id="@+id/tabs"
|
||||||
|
app:tabTextColor="?attr/primaryTextColor"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/backgroundColor" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -355,6 +355,7 @@
|
||||||
|
|
||||||
<style name="chat_message_emoji_reaction_font">
|
<style name="chat_message_emoji_reaction_font">
|
||||||
<item name="android:textSize">@dimen/chat_message_emoji_reaction_font_size</item>
|
<item name="android:textSize">@dimen/chat_message_emoji_reaction_font_size</item>
|
||||||
|
<item name="android:textColor">?attr/primaryTextColor</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Dialog related -->
|
<!-- Dialog related -->
|
||||||
|
|
Loading…
Reference in a new issue