From 3a11b9900e08ef89f74e6229b91be7550a9f5895 Mon Sep 17 00:00:00 2001 From: Constantin A <10349490+C1710@users.noreply.github.com> Date: Thu, 28 Apr 2022 18:55:10 +0200 Subject: [PATCH] EmojiCompat fix (#2468) * Add back the emojiInitCallback and move EmojiCompat init * Small adjustments * Make sure that we don't hit the IllegalStateException when EmojiCompat-ing the display names * Add a TODO for when Material Drawer 9 can be used * Remove EmojiCompat.process and initcallback --- app/src/main/java/com/keylesspalace/tusky/MainActivity.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt index 3e203059..466dba16 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.kt @@ -36,7 +36,6 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.content.ContextCompat import androidx.core.content.pm.ShortcutManagerCompat import androidx.core.view.GravityCompat -import androidx.emoji2.text.EmojiCompat import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.preference.PreferenceManager @@ -810,11 +809,9 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje private fun updateProfiles() { val animateEmojis = preferences.getBoolean(PrefKeys.ANIMATE_CUSTOM_EMOJIS, false) val profiles: MutableList = accountManager.getAllAccountsOrderedByActive().map { acc -> - val emojifiedName = EmojiCompat.get().process(acc.displayName.emojify(acc.emojis, header, animateEmojis))!! - ProfileDrawerItem().apply { isSelected = acc.isActive - nameText = emojifiedName + nameText = acc.displayName.emojify(acc.emojis, header, animateEmojis) iconUrl = acc.profilePictureUrl isNameShown = true identifier = acc.id