remove redundant options from account toolbar (#2075)
This commit is contained in:
parent
ff7d900b67
commit
e3b79097d4
2 changed files with 1 additions and 26 deletions
|
@ -661,14 +661,6 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
|
||||||
menuInflater.inflate(R.menu.account_toolbar, menu)
|
menuInflater.inflate(R.menu.account_toolbar, menu)
|
||||||
|
|
||||||
if (!viewModel.isSelf) {
|
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)
|
val block = menu.findItem(R.id.action_block)
|
||||||
block.title = if (blocking) {
|
block.title = if (blocking) {
|
||||||
|
@ -712,8 +704,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// It shouldn't be possible to block, follow, mute or report yourself.
|
// It shouldn't be possible to block, mute or report yourself.
|
||||||
menu.removeItem(R.id.action_follow)
|
|
||||||
menu.removeItem(R.id.action_block)
|
menu.removeItem(R.id.action_block)
|
||||||
menu.removeItem(R.id.action_mute)
|
menu.removeItem(R.id.action_mute)
|
||||||
menu.removeItem(R.id.action_mute_domain)
|
menu.removeItem(R.id.action_mute_domain)
|
||||||
|
@ -805,10 +796,6 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
R.id.action_mention -> {
|
|
||||||
mention()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
R.id.action_open_in_web -> {
|
R.id.action_open_in_web -> {
|
||||||
// If the account isn't loaded yet, eat the input.
|
// If the account isn't loaded yet, eat the input.
|
||||||
if (loadedAccount != null) {
|
if (loadedAccount != null) {
|
||||||
|
@ -816,10 +803,6 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidI
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
R.id.action_follow -> {
|
|
||||||
viewModel.changeFollowState()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
R.id.action_block -> {
|
R.id.action_block -> {
|
||||||
toggleBlock()
|
toggleBlock()
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -2,18 +2,10 @@
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
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"
|
<item android:id="@+id/action_open_in_web"
|
||||||
android:title="@string/action_open_in_web"
|
android:title="@string/action_open_in_web"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
<item android:id="@+id/action_follow"
|
|
||||||
android:title="@string/action_follow"
|
|
||||||
app:showAsAction="never" />
|
|
||||||
|
|
||||||
<item android:id="@+id/action_mute"
|
<item android:id="@+id/action_mute"
|
||||||
android:title="@string/action_mute"
|
android:title="@string/action_mute"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
Loading…
Reference in a new issue