From aa16178a78f4d5d1b5e4fd87c5605c62ba943b6b Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Tue, 3 Oct 2023 21:03:07 +0200 Subject: [PATCH] Don't show lock option if encryption is disabled --- .../com/cringe_studios/code_guard/MainActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/com/cringe_studios/code_guard/MainActivity.java b/app/src/main/java/com/cringe_studios/code_guard/MainActivity.java index 2e9120d..48f7570 100644 --- a/app/src/main/java/com/cringe_studios/code_guard/MainActivity.java +++ b/app/src/main/java/com/cringe_studios/code_guard/MainActivity.java @@ -272,6 +272,11 @@ public class MainActivity extends BaseActivity { if(fragment instanceof GroupFragment) { GroupFragment frag = (GroupFragment) fragment; getMenuInflater().inflate(frag.isEditing() ? R.menu.menu_otps_edit : R.menu.menu_otps, menu); + + if(!SettingsUtil.isDatabaseEncrypted(this)) { + menu.removeItem(R.id.action_lock); + } + if(frag.isEditing() && frag.hasSelectedMultipleItems()) { menu.removeItem(R.id.action_view_otp); menu.removeItem(R.id.action_edit_otp); @@ -285,6 +290,11 @@ public class MainActivity extends BaseActivity { } getMenuInflater().inflate(R.menu.menu_main, menu); + + if(!SettingsUtil.isDatabaseEncrypted(this)) { + menu.removeItem(R.id.action_lock); + } + return true; }