mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 04:08:44 +03:00
Hide menu if not in developer mode
This commit is contained in:
parent
b870a8b791
commit
649edffa30
2 changed files with 9 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue