Skip to content

Commit

Permalink
add some margins to the reactions on a message
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Scherzinger <[email protected]>
  • Loading branch information
AndyScherzinger authored and mahibi committed Apr 6, 2022
1 parent b7bb455 commit 0e86883
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
params.setMargins(0, 0, EMOJI_RIGHT_MARGIN, 0)
params.setMargins(
DisplayUtils.convertDpToPixel(EMOJI_START_MARGIN, context).toInt(),
0,
DisplayUtils.convertDpToPixel(EMOJI_END_MARGIN, context).toInt(),
0
)
reactionAmount.layoutParams = params

binding.reactionsEmojiWrapper.addView(reactionEmoji)
Expand Down Expand Up @@ -308,6 +313,7 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
companion object {
const val TEXT_SIZE_MULTIPLIER = 2.5
const val MAX_EMOJIS_TO_DISPLAY = 4
const val EMOJI_RIGHT_MARGIN: Int = 10
const val EMOJI_START_MARGIN: Float = 2F
const val EMOJI_END_MARGIN: Float = 8F
}
}

0 comments on commit 0e86883

Please sign in to comment.