Skip to content

Commit

Permalink
add margin between reactions
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Hibbe <[email protected]>
  • Loading branch information
mahibi committed Apr 1, 2022
1 parent 6285a44 commit 2056c21
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -144,7 +155,7 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
val infoAboutMoreEmojis = TextView(context)
infoAboutMoreEmojis.text = "..."
binding.reactionsEmojiWrapper.addView(infoAboutMoreEmojis)
break;
break
}
}
}
Expand Down

0 comments on commit 2056c21

Please sign in to comment.