diff --git a/app/src/main/java/com/keylesspalace/tusky/components/account/AccountActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/account/AccountActivity.kt index bf97d85b..4f1627ae 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/account/AccountActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/account/AccountActivity.kt @@ -488,18 +488,23 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI .centerCrop() .into(binding.accountHeaderImageView) - binding.accountAvatarImageView.setOnClickListener { avatarView -> - val intent = - ViewMediaActivity.newSingleImageIntent(avatarView.context, account.avatar) - - avatarView.transitionName = account.avatar - val options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, avatarView, account.avatar) - - startActivity(intent, options.toBundle()) + binding.accountAvatarImageView.setOnClickListener { view -> + viewImage(view, account.avatar) + } + binding.accountHeaderImageView.setOnClickListener { view -> + viewImage(view, account.header) } } } + private fun viewImage(view: View, uri: String) { + view.transitionName = uri + startActivity( + ViewMediaActivity.newSingleImageIntent(view.context, uri), + ActivityOptionsCompat.makeSceneTransitionAnimation(this, view, uri).toBundle() + ) + } + /** * Update toolbar views for loaded account */