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()
.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
*/