Add support for jumbo emoji.

This commit is contained in:
Cody Henthorne
2022-01-06 10:24:08 -05:00
committed by Alex Hart
parent 449acaf9df
commit 34f679b10b
20 changed files with 401 additions and 163 deletions

View File

@@ -34,14 +34,13 @@ class TextAvatarDrawable(
val textSize = Avatars.getTextSizeForLength(context, avatar.text, size * 0.8f, size * 0.45f)
val width = bounds.width()
val candidates = EmojiProvider.getCandidates(avatar.text)
var hasEmoji = false
textPaint.textSize = textSize
val newText = if (candidates == null || candidates.size() == 0) {
SpannableString(avatar.text)
} else {
EmojiProvider.emojify(context, candidates, avatar.text, textPaint, synchronous)
EmojiProvider.emojify(context, candidates, avatar.text, textPaint, synchronous, true)
}
if (newText == null) return