mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Hide menu if not in developer mode
This commit is contained in:
parent
b870a8b791
commit
649edffa30
@ -21,6 +21,7 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
@ -362,6 +363,12 @@ class HomeActivity :
|
||||
|
||||
override fun getMenuRes() = R.menu.home
|
||||
|
||||
override fun onPrepareOptionsMenu(menu: Menu): Boolean {
|
||||
menu.findItem(R.id.menu_home_init_sync_legacy)?.isVisible = vectorPreferences.developerMode()
|
||||
menu.findItem(R.id.menu_home_init_sync_optimized)?.isVisible = vectorPreferences.developerMode()
|
||||
return super.onPrepareOptionsMenu(menu)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.menu_home_suggestion -> {
|
||||
|
@ -21,12 +21,12 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_home_init_sync_legacy"
|
||||
android:title="Init sync legacy"
|
||||
android:title="Do a legacy init sync"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_home_init_sync_optimized"
|
||||
android:title="Init sync optimized"
|
||||
android:title="Do an optimized init sync"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<item
|
||||
|
Loading…
Reference in New Issue
Block a user