Don't show lock option if encryption is disabled

This commit is contained in:
MrLetsplay 2023-10-03 21:03:07 +02:00
parent 4ffd39596b
commit aa16178a78
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg

View File

@ -272,6 +272,11 @@ public class MainActivity extends BaseActivity {
if(fragment instanceof GroupFragment) { if(fragment instanceof GroupFragment) {
GroupFragment frag = (GroupFragment) fragment; GroupFragment frag = (GroupFragment) fragment;
getMenuInflater().inflate(frag.isEditing() ? R.menu.menu_otps_edit : R.menu.menu_otps, menu); 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()) { if(frag.isEditing() && frag.hasSelectedMultipleItems()) {
menu.removeItem(R.id.action_view_otp); menu.removeItem(R.id.action_view_otp);
menu.removeItem(R.id.action_edit_otp); menu.removeItem(R.id.action_edit_otp);
@ -285,6 +290,11 @@ public class MainActivity extends BaseActivity {
} }
getMenuInflater().inflate(R.menu.menu_main, menu); getMenuInflater().inflate(R.menu.menu_main, menu);
if(!SettingsUtil.isDatabaseEncrypted(this)) {
menu.removeItem(R.id.action_lock);
}
return true; return true;
} }