diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-11-02 15:44:31 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-11-02 15:44:31 +0100 |
commit | 7bb48465e21a8468a5a9ed61b81989903c8b36a4 (patch) | |
tree | e2c3819e36c108f55722c4d62300a3fded6fdfdd /src/standardPush/java/de/pixart/messenger/services/EmojiService.java | |
parent | 6e386a8701190aad9e5adfa83c48ef9ea1582f1e (diff) |
rename build flavors
Diffstat (limited to 'src/standardPush/java/de/pixart/messenger/services/EmojiService.java')
-rw-r--r-- | src/standardPush/java/de/pixart/messenger/services/EmojiService.java | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/standardPush/java/de/pixart/messenger/services/EmojiService.java b/src/standardPush/java/de/pixart/messenger/services/EmojiService.java deleted file mode 100644 index 0e5bfadd0..000000000 --- a/src/standardPush/java/de/pixart/messenger/services/EmojiService.java +++ /dev/null @@ -1,53 +0,0 @@ -package de.pixart.messenger.services; - -import android.content.Context; -import android.os.Build; -import android.util.Log; - -import androidx.core.provider.FontRequest; -import androidx.emoji.text.EmojiCompat; -import androidx.emoji.text.FontRequestEmojiCompatConfig; - -import de.pixart.messenger.Config; -import de.pixart.messenger.R; - -public class EmojiService { - - private final EmojiCompat.InitCallback initCallback = new EmojiCompat.InitCallback() { - @Override - public void onInitialized() { - super.onInitialized(); - Log.d(Config.LOGTAG, "EmojiService succeeded in loading fonts"); - - } - - @Override - public void onFailed(Throwable throwable) { - super.onFailed(throwable); - Log.d(Config.LOGTAG, "EmojiService failed to load fonts", throwable); - } - }; - - private final Context context; - - public EmojiService(Context context) { - this.context = context; - } - - public void init(boolean useBundledEmoji) { - final FontRequest fontRequest = new FontRequest( - "com.google.android.gms.fonts", - "com.google.android.gms", - "Noto Color Emoji Compat", - R.array.font_certs); - FontRequestEmojiCompatConfig fontRequestEmojiCompatConfig = new FontRequestEmojiCompatConfig(context, fontRequest); - fontRequestEmojiCompatConfig.registerInitCallback(initCallback); - //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) - // c) can trigger a hardware rendering bug https://issuetracker.google.com/issues/67102093 - fontRequestEmojiCompatConfig.setReplaceAll(useBundledEmoji && Build.VERSION.SDK_INT < Build.VERSION_CODES.O); - EmojiCompat.init(fontRequestEmojiCompatConfig); - } -}
\ No newline at end of file |