From 92fd44c63b37d1b10145e5481d2e34d8fe7b9253 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Wed, 8 Mar 2023 10:49:42 +0100 Subject: [PATCH] Add Debug item programmatically --- .../java/de/rki/coronawarnapp/ui/main/home/HomeFragment.kt | 4 +++- Corona-Warn-App/src/main/res/menu/menu_main.xml | 6 ------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/main/home/HomeFragment.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/main/home/HomeFragment.kt index 0e6391d44e0..6323cd6943e 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/main/home/HomeFragment.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/main/home/HomeFragment.kt @@ -173,7 +173,9 @@ class HomeFragment : Fragment(R.layout.home_fragment_layout), AutoInject { } private fun setupDebugMenu(menu: Menu) { - menu.findItem(R.id.test_nav_graph).isVisible = CWADebug.isDeviceForTestersBuild + if (CWADebug.isDeviceForTestersBuild) { + menu.add(Menu.NONE, R.id.test_nav_graph, menu.size() + 1, "Test Menu") + } } private fun MaterialToolbar.setupMenuItemClickListener() { diff --git a/Corona-Warn-App/src/main/res/menu/menu_main.xml b/Corona-Warn-App/src/main/res/menu/menu_main.xml index 0243e06c0d3..e73a05291e1 100644 --- a/Corona-Warn-App/src/main/res/menu/menu_main.xml +++ b/Corona-Warn-App/src/main/res/menu/menu_main.xml @@ -35,10 +35,4 @@ android:id="@+id/mainOverviewFragment" android:icon="@drawable/ic_menu_overview" android:title="@string/menu_help" /> - -