Add FAB to self account view (#3067)

Fixes 3058
This commit is contained in:
Eric Frohnhoefer 2022-12-30 02:22:01 -08:00 committed by GitHub
parent c7254bfc19
commit 65e95a7858
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -318,7 +318,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
supportActionBar?.setDisplayShowTitleEnabled(false) supportActionBar?.setDisplayShowTitleEnabled(false)
} }
if (hideFab && !viewModel.isSelf && !blocking) { if (hideFab && !blocking) {
if (verticalOffset > oldOffset) { if (verticalOffset > oldOffset) {
binding.accountFloatingActionButton.show() binding.accountFloatingActionButton.show()
} }
@ -665,7 +665,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
binding.accountFollowButton.show() binding.accountFollowButton.show()
updateFollowButton() updateFollowButton()
if (blocking || viewModel.isSelf) { if (blocking) {
binding.accountFloatingActionButton.hide() binding.accountFloatingActionButton.hide()
binding.accountMuteButton.hide() binding.accountMuteButton.hide()
binding.accountSubscribeButton.hide() binding.accountSubscribeButton.hide()
@ -810,10 +810,12 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
private fun mention() { private fun mention() {
loadedAccount?.let { loadedAccount?.let {
val intent = ComposeActivity.startIntent( val options = if (viewModel.isSelf) {
this, ComposeActivity.ComposeOptions()
} else {
ComposeActivity.ComposeOptions(mentionedUsernames = setOf(it.username)) ComposeActivity.ComposeOptions(mentionedUsernames = setOf(it.username))
) }
val intent = ComposeActivity.startIntent(this, options)
startActivity(intent) startActivity(intent)
} }
} }
@ -885,7 +887,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
} }
override fun getActionButton(): FloatingActionButton? { override fun getActionButton(): FloatingActionButton? {
return if (!viewModel.isSelf && !blocking) { return if (!blocking) {
binding.accountFloatingActionButton binding.accountFloatingActionButton
} else null } else null
} }