From 649edffa30cbdadf5d2009f5072841e84160220f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 9 Feb 2021 11:04:47 +0100 Subject: [PATCH] Hide menu if not in developer mode --- .../main/java/im/vector/app/features/home/HomeActivity.kt | 7 +++++++ vector/src/main/res/menu/home.xml | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt index 2d884f1ba7..2a0ef0bdd6 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivity.kt @@ -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 -> { diff --git a/vector/src/main/res/menu/home.xml b/vector/src/main/res/menu/home.xml index 66cbf53bfd..463b8a9e0d 100644 --- a/vector/src/main/res/menu/home.xml +++ b/vector/src/main/res/menu/home.xml @@ -21,12 +21,12 @@