Allow viewing of the account header image. (#3274)

Fixes #3254
This commit is contained in:
Levi Bard 2023-02-20 20:06:50 +01:00 committed by GitHub
parent cfea5700b0
commit 41d493e72a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 8 deletions

View File

@ -488,18 +488,23 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
.centerCrop() .centerCrop()
.into(binding.accountHeaderImageView) .into(binding.accountHeaderImageView)
binding.accountAvatarImageView.setOnClickListener { avatarView -> binding.accountAvatarImageView.setOnClickListener { view ->
val intent = viewImage(view, account.avatar)
ViewMediaActivity.newSingleImageIntent(avatarView.context, account.avatar) }
binding.accountHeaderImageView.setOnClickListener { view ->
avatarView.transitionName = account.avatar viewImage(view, account.header)
val options = ActivityOptionsCompat.makeSceneTransitionAnimation(this, avatarView, account.avatar)
startActivity(intent, options.toBundle())
} }
} }
} }
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 * Update toolbar views for loaded account
*/ */