From 422b6affc581350688684bb37100c2343f5b6728 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Fri, 1 Apr 2022 14:31:46 +0200 Subject: [PATCH] add margin between reactions Signed-off-by: Marcel Hibbe --- .../messages/MagicIncomingTextMessageViewHolder.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt index 3831d405d0f..3be34db3168 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt @@ -36,12 +36,16 @@ import android.text.SpannableString import android.text.TextUtils import android.util.TypedValue import android.view.View +import android.view.ViewGroup +import android.widget.RelativeLayout import android.widget.TextView import androidx.core.content.ContextCompat import androidx.core.content.res.ResourcesCompat import androidx.core.view.ViewCompat import androidx.core.view.children import androidx.core.view.get +import androidx.core.view.marginEnd +import androidx.core.view.updateLayoutParams import autodagger.AutoInjector import coil.load import com.amulyakhare.textdrawable.TextDrawable @@ -136,6 +140,13 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message val reactionAmount = TextView(context) reactionAmount.text = amount.toString() + val params = RelativeLayout.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT + ) + params.setMargins(0, 0, 10, 0) + reactionAmount.layoutParams = params + binding.reactionsEmojiWrapper.addView(reactionEmoji) binding.reactionsEmojiWrapper.addView(reactionAmount) @@ -144,7 +155,7 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message val infoAboutMoreEmojis = TextView(context) infoAboutMoreEmojis.text = "..." binding.reactionsEmojiWrapper.addView(infoAboutMoreEmojis) - break; + break } } }