setReplaceAll=false on emojiCompat for android o

This commit is contained in:
Daniel Gultsch 2018-03-17 21:43:18 +01:00
parent 11dfd87672
commit 83a4cb8a11
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package eu.siacs.conversations.ui.service; package eu.siacs.conversations.ui.service;
import android.content.Context; import android.content.Context;
import android.os.Build;
import android.support.text.emoji.EmojiCompat; import android.support.text.emoji.EmojiCompat;
public abstract class AbstractEmojiService { public abstract class AbstractEmojiService {
@ -15,7 +16,11 @@ public abstract class AbstractEmojiService {
public void init() { public void init() {
final EmojiCompat.Config config = buildConfig(); final EmojiCompat.Config config = buildConfig();
config.setReplaceAll(true); //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 dont work
// b) the text preview has annoying glitches when the cut of text contains emojis (the emoji will be half visible)
config.setReplaceAll(Build.VERSION.SDK_INT < Build.VERSION_CODES.O);
EmojiCompat.init(config); EmojiCompat.init(config);
} }
} }