diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AbstractEmojiService.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AbstractEmojiService.java b/src/main/java/de/pixart/messenger/services/AbstractEmojiService.java index 58cb5eaa4..5eacdb676 100644 --- a/src/main/java/de/pixart/messenger/services/AbstractEmojiService.java +++ b/src/main/java/de/pixart/messenger/services/AbstractEmojiService.java @@ -1,6 +1,7 @@ package de.pixart.messenger.services; import android.content.Context; +import android.os.Build; import android.support.text.emoji.EmojiCompat; import android.util.Log; @@ -18,9 +19,13 @@ public abstract class AbstractEmojiService { public void init(boolean useBundledEmoji) { Log.d(Config.LOGTAG, "Emojis: use integrated lib " + useBundledEmoji); - EmojiCompat.Config config = buildConfig(); - config.setReplaceAll(useBundledEmoji); - EmojiCompat.reset(config); + final EmojiCompat.Config config = buildConfig(); + //On recent Androids we assume to have the latest emojis + //there are some annoying bugs with emoji compat that make it a safer choice not to use it when possible + // a) when using the ondemand emoji font (play store) flags don’t work + // b) the text preview has annoying glitches when the cut of text contains emojis (the emoji will be half visible) + config.setReplaceAll(useBundledEmoji && Build.VERSION.SDK_INT < Build.VERSION_CODES.O); + EmojiCompat.init(config); } }
\ No newline at end of file |