remove redundant options from account toolbar (#2075)

This commit is contained in:
Konrad Pozniak 2021-02-18 19:26:14 +01:00 committed by GitHub
parent ff7d900b67
commit e3b79097d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 26 deletions

View File

@ -661,14 +661,6 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
menuInflater.inflate(R.menu.account_toolbar, menu)
if (!viewModel.isSelf) {
val follow = menu.findItem(R.id.action_follow)
follow.title = if (followState == FollowState.NOT_FOLLOWING) {
getString(R.string.action_follow)
} else {
getString(R.string.action_unfollow)
}
follow.isVisible = followState != FollowState.REQUESTED
val block = menu.findItem(R.id.action_block)
block.title = if (blocking) {
@ -712,8 +704,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
}
} else {
// It shouldn't be possible to block, follow, mute or report yourself.
menu.removeItem(R.id.action_follow)
// It shouldn't be possible to block, mute or report yourself.
menu.removeItem(R.id.action_block)
menu.removeItem(R.id.action_mute)
menu.removeItem(R.id.action_mute_domain)
@ -805,10 +796,6 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_mention -> {
mention()
return true
}
R.id.action_open_in_web -> {
// If the account isn't loaded yet, eat the input.
if (loadedAccount != null) {
@ -816,10 +803,6 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
}
return true
}
R.id.action_follow -> {
viewModel.changeFollowState()
return true
}
R.id.action_block -> {
toggleBlock()
return true

View File

@ -2,18 +2,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_mention"
android:title="@string/action_mention"
app:showAsAction="never" />
<item android:id="@+id/action_open_in_web"
android:title="@string/action_open_in_web"
app:showAsAction="never" />
<item android:id="@+id/action_follow"
android:title="@string/action_follow"
app:showAsAction="never" />
<item android:id="@+id/action_mute"
android:title="@string/action_mute"
app:showAsAction="never" />