From 65e95a78585ab56e69506261de01c918d85df849 Mon Sep 17 00:00:00 2001 From: Eric Frohnhoefer Date: Fri, 30 Dec 2022 02:22:01 -0800 Subject: [PATCH] Add FAB to self account view (#3067) Fixes 3058 --- .../tusky/components/account/AccountActivity.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 57ce3474..f4bc8ce6 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 @@ -318,7 +318,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI supportActionBar?.setDisplayShowTitleEnabled(false) } - if (hideFab && !viewModel.isSelf && !blocking) { + if (hideFab && !blocking) { if (verticalOffset > oldOffset) { binding.accountFloatingActionButton.show() } @@ -665,7 +665,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI binding.accountFollowButton.show() updateFollowButton() - if (blocking || viewModel.isSelf) { + if (blocking) { binding.accountFloatingActionButton.hide() binding.accountMuteButton.hide() binding.accountSubscribeButton.hide() @@ -810,10 +810,12 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI private fun mention() { loadedAccount?.let { - val intent = ComposeActivity.startIntent( - this, + val options = if (viewModel.isSelf) { + ComposeActivity.ComposeOptions() + } else { ComposeActivity.ComposeOptions(mentionedUsernames = setOf(it.username)) - ) + } + val intent = ComposeActivity.startIntent(this, options) startActivity(intent) } } @@ -885,7 +887,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI } override fun getActionButton(): FloatingActionButton? { - return if (!viewModel.isSelf && !blocking) { + return if (!blocking) { binding.accountFloatingActionButton } else null }