Animated emoji support (#2064)
* Animated emoji support * Try to query preference only once * Revert to using SpannableStringBuilder
This commit is contained in:
parent
c685192d49
commit
9580870445
38 changed files with 225 additions and 120 deletions
|
|
@ -23,6 +23,7 @@ import android.widget.ArrayAdapter
|
|||
import androidx.preference.PreferenceManager
|
||||
import com.keylesspalace.tusky.R
|
||||
import com.keylesspalace.tusky.db.AccountEntity
|
||||
import com.keylesspalace.tusky.settings.PrefKeys
|
||||
import com.keylesspalace.tusky.util.*
|
||||
import kotlinx.android.synthetic.main.item_autocomplete_account.view.*
|
||||
|
||||
|
|
@ -41,12 +42,14 @@ class AccountSelectionAdapter(context: Context) : ArrayAdapter<AccountEntity>(co
|
|||
val username = view.username
|
||||
val displayName = view.display_name
|
||||
val avatar = view.avatar
|
||||
val pm = PreferenceManager.getDefaultSharedPreferences(avatar.context)
|
||||
val animateEmojis = pm.getBoolean(PrefKeys.ANIMATE_CUSTOM_EMOJIS, false)
|
||||
|
||||
username.text = account.fullName
|
||||
displayName.text = account.displayName.emojify(account.emojis, displayName)
|
||||
displayName.text = account.displayName.emojify(account.emojis, displayName, animateEmojis)
|
||||
|
||||
val avatarRadius = avatar.context.resources.getDimensionPixelSize(R.dimen.avatar_radius_42dp)
|
||||
val animateAvatar = PreferenceManager.getDefaultSharedPreferences(avatar.context)
|
||||
.getBoolean("animateGifAvatars", false)
|
||||
val animateAvatar = pm.getBoolean("animateGifAvatars", false)
|
||||
|
||||
loadAvatar(account.profilePictureUrl, avatar, avatarRadius, animateAvatar)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue