Skip to content

Commit

Permalink
don't show bot badge for all accounts when searching in AccountsInLis…
Browse files Browse the repository at this point in the history
…tFragment (#4853)
  • Loading branch information
connyduck authored Jan 6, 2025
1 parent 592a8e2 commit 2f91967
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class AccountsInListFragment : DialogFragment() {

private val radius by unsafeLazy { resources.getDimensionPixelSize(R.dimen.avatar_radius_48dp) }

private val animateAvatar by unsafeLazy { preferences.getBoolean(PrefKeys.ANIMATE_GIF_AVATARS, false) }
private val animateEmojis by unsafeLazy { preferences.getBoolean(PrefKeys.ANIMATE_CUSTOM_EMOJIS, false) }
private val showBotOverlay by unsafeLazy { preferences.getBoolean(PrefKeys.SHOW_BOT_OVERLAY, true) }

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val args = requireArguments()
Expand Down Expand Up @@ -202,9 +206,6 @@ class AccountsInListFragment : DialogFragment() {
position: Int
) {
val account = getItem(position)
val animateAvatar = preferences.getBoolean(PrefKeys.ANIMATE_GIF_AVATARS, false)
val animateEmojis = preferences.getBoolean(PrefKeys.ANIMATE_CUSTOM_EMOJIS, false)
val showBotOverlay = preferences.getBoolean(PrefKeys.SHOW_BOT_OVERLAY, false)
holder.binding.displayNameTextView.text = account.name.emojify(account.emojis, holder.binding.displayNameTextView, animateEmojis)
holder.binding.usernameTextView.text = account.username
holder.binding.avatarBadge.visible(showBotOverlay && account.bot)
Expand Down Expand Up @@ -257,11 +258,9 @@ class AccountsInListFragment : DialogFragment() {
) {
val (account, inAList) = getItem(position)

val animateAvatar = preferences.getBoolean(PrefKeys.ANIMATE_GIF_AVATARS, false)
val animateEmojis = preferences.getBoolean(PrefKeys.ANIMATE_CUSTOM_EMOJIS, false)

holder.binding.displayNameTextView.text = account.name.emojify(account.emojis, holder.binding.displayNameTextView, animateEmojis)
holder.binding.usernameTextView.text = account.username
holder.binding.avatarBadge.visible(showBotOverlay && account.bot)
loadAvatar(account.avatar, holder.binding.avatar, radius, animateAvatar)

holder.binding.rejectButton.apply {
Expand Down

0 comments on commit 2f91967

Please sign in to comment.