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
This commit is contained in:
parent
0e9d362351
commit
3a11b9900e
1 changed files with 1 additions and 4 deletions
|
@ -36,7 +36,6 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.content.pm.ShortcutManagerCompat
|
import androidx.core.content.pm.ShortcutManagerCompat
|
||||||
import androidx.core.view.GravityCompat
|
import androidx.core.view.GravityCompat
|
||||||
import androidx.emoji2.text.EmojiCompat
|
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
|
@ -810,11 +809,9 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
|
||||||
private fun updateProfiles() {
|
private fun updateProfiles() {
|
||||||
val animateEmojis = preferences.getBoolean(PrefKeys.ANIMATE_CUSTOM_EMOJIS, false)
|
val animateEmojis = preferences.getBoolean(PrefKeys.ANIMATE_CUSTOM_EMOJIS, false)
|
||||||
val profiles: MutableList<IProfile> = accountManager.getAllAccountsOrderedByActive().map { acc ->
|
val profiles: MutableList<IProfile> = accountManager.getAllAccountsOrderedByActive().map { acc ->
|
||||||
val emojifiedName = EmojiCompat.get().process(acc.displayName.emojify(acc.emojis, header, animateEmojis))!!
|
|
||||||
|
|
||||||
ProfileDrawerItem().apply {
|
ProfileDrawerItem().apply {
|
||||||
isSelected = acc.isActive
|
isSelected = acc.isActive
|
||||||
nameText = emojifiedName
|
nameText = acc.displayName.emojify(acc.emojis, header, animateEmojis)
|
||||||
iconUrl = acc.profilePictureUrl
|
iconUrl = acc.profilePictureUrl
|
||||||
isNameShown = true
|
isNameShown = true
|
||||||
identifier = acc.id
|
identifier = acc.id
|
||||||
|
|
Loading…
Reference in a new issue