Fix animated emoji not working if using system emoji, close #46

This commit is contained in:
NekoInverter 2020-02-25 15:41:45 +08:00
parent d929865e8d
commit 2750b495d2
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
1 changed files with 8 additions and 9 deletions

View File

@ -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;