From 2750b495d2d837baf1f9f2ab8c5f3f5e8fbfdb49 Mon Sep 17 00:00:00 2001 From: NekoInverter <42698724+NekoInverter@users.noreply.github.com> Date: Tue, 25 Feb 2020 15:41:45 +0800 Subject: [PATCH] Fix animated emoji not working if using system emoji, close #46 --- .../main/java/org/telegram/messenger/Emoji.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java b/TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java index a24c070e7..f985ec084 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java @@ -333,9 +333,6 @@ public class Emoji { } else { s = Spannable.Factory.getInstance().newSpannable(cs.toString()); } - if (SharedConfig.useSystemEmoji) { - return s; - } long buf = 0; int emojiCount = 0; char c; @@ -458,12 +455,14 @@ public class Emoji { if (emojiOnly != null) { emojiOnly[0]++; } - CharSequence code = emojiCode.subSequence(0, emojiCode.length()); - drawable = Emoji.getEmojiDrawable(code); - if (drawable != null) { - span = new EmojiSpan(drawable, DynamicDrawableSpan.ALIGN_BOTTOM, size, fontMetrics); - s.setSpan(span, startIndex, startIndex + startLength, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - emojiCount++; + if (!SharedConfig.useSystemEmoji) { + CharSequence code = emojiCode.subSequence(0, emojiCode.length()); + drawable = Emoji.getEmojiDrawable(code); + if (drawable != null) { + span = new EmojiSpan(drawable, DynamicDrawableSpan.ALIGN_BOTTOM, size, fontMetrics); + s.setSpan(span, startIndex, startIndex + startLength, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + emojiCount++; + } } startLength = 0; startIndex = -1;