emoji: use bundled compat font

main
Alibek Omarov 5 years ago
parent 8d89f83bae
commit ceadb76785
  1. 8
      app/build.gradle
  2. 7
      app/src/main/java/com/keylesspalace/tusky/util/EmojiCompatFont.java

@ -22,6 +22,7 @@ def buildnum = {
android { android {
compileSdkVersion 29 compileSdkVersion 29
ndkVersion "20.1.5948944"
defaultConfig { defaultConfig {
applicationId APP_ID applicationId APP_ID
minSdkVersion 21 minSdkVersion 21
@ -33,7 +34,7 @@ android {
resValue "string", "app_name", APP_NAME resValue "string", "app_name", APP_NAME
buildConfigField("String", "APPLICATION_NAME", "\"$APP_NAME\"") buildConfigField("String", "APPLICATION_NAME", "\"$APP_NAME\"")
buildConfigField("String", "CUSTOM_LOGO_URL", "\"$CUSTOM_LOGO_URL\"") buildConfigField("String", "CUSTOM_LOGO_URL", "\"$CUSTOM_LOGO_URL\"")
buildConfigField("String", "CUSTOM_INSTANCE", "\"$CUSTOM_INSTANCE\"") buildConfigField("String", "CUSTOM_INSTANCE", "\"$CUSTOM_INSTANCE\"")
buildConfigField("String", "SUPPORT_ACCOUNT_URL", "\"$SUPPORT_ACCOUNT_URL\"") buildConfigField("String", "SUPPORT_ACCOUNT_URL", "\"$SUPPORT_ACCOUNT_URL\"")
@ -126,8 +127,9 @@ dependencies {
implementation "androidx.cardview:cardview:1.0.0" implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.preference:preference:1.1.0" implementation "androidx.preference:preference:1.1.0"
implementation "androidx.sharetarget:sharetarget:1.0.0-rc01" implementation "androidx.sharetarget:sharetarget:1.0.0-rc01"
implementation "androidx.emoji:emoji:1.0.0" implementation "androidx.emoji:emoji:1.1.0-beta01"
implementation "androidx.emoji:emoji-appcompat:1.0.0" implementation "androidx.emoji:emoji-appcompat:1.1.0-beta01"
implementation "androidx.emoji:emoji-bundled:1.1.0-beta01"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycleVersion"

@ -9,6 +9,8 @@ import android.util.Pair;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.emoji.text.EmojiCompat;
import androidx.emoji.bundled.BundledEmojiCompatConfig;
import com.keylesspalace.tusky.R; import com.keylesspalace.tusky.R;
@ -173,7 +175,10 @@ public class EmojiCompatFont {
} }
public FileEmojiCompatConfig getConfig(Context context) { public EmojiCompat.Config getConfig(Context context) {
if(this == SYSTEM_DEFAULT) {
return new BundledEmojiCompatConfig(context);
}
return new FileEmojiCompatConfig(context, getLatestFontFile(context)); return new FileEmojiCompatConfig(context, getLatestFontFile(context));
} }

Loading…
Cancel
Save