mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-06-08 23:57:45 +00:00
Add an option to automatically lock the app
This adds an option to automatically lock the app when: * The back button is pressed * The device is locked It's the first step towards implementing #7
This commit is contained in:
parent
6d93b78f9a
commit
18fd88a441
5 changed files with 45 additions and 2 deletions
|
@ -363,6 +363,15 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
updateLockIcon();
|
||||
}
|
||||
|
||||
@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);
|
||||
|
@ -428,6 +437,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) {
|
||||
|
@ -475,7 +485,6 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
_entryListView.clearEntries();
|
||||
_db.lock();
|
||||
_loaded = false;
|
||||
startAuthActivity();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue