Merge pull request #53 from alexbakker/feature-autolock

Add an option to automatically lock the app
This commit is contained in:
Michael Schättgen 2019-04-09 17:34:47 +02:00 committed by GitHub
commit 1ac42d85d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 2 deletions

View file

@ -356,6 +356,15 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
doShortcutActions();
}
@Override
public void onBackPressed() {
if (_app.isAutoLockEnabled()) {
lockDatabase();
}
super.onBackPressed();
}
private BottomSheetDialog createBottomSheet(final DatabaseEntry entry) {
BottomSheetDialog dialog = new BottomSheetDialog(this);
dialog.setContentView(R.layout.bottom_sheet_edit_entry);
@ -421,6 +430,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
return true;
case R.id.action_lock:
lockDatabase();
startAuthActivity();
return true;
default:
if (item.getGroupId() == R.id.action_filter_group) {
@ -468,7 +478,6 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
_entryListView.clearEntries();
_db.lock();
_loaded = false;
startAuthActivity();
}
}