Skip to content

Commit

Permalink
Update sort category radio button state in the menu
Browse files Browse the repository at this point in the history
This has been broken since 46e1421.

I also removed some other logic from ``onCreateOptionsMenu`` that
doesn't seem to belong there anymore.
  • Loading branch information
alexbakker committed Nov 15, 2024
1 parent 6d8eec0 commit 9d383b8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,10 @@ private void importScannedEntries(List<VaultEntry> entries) {
}

private void updateSortCategoryMenu() {
SortCategory category = _prefs.getCurrentSortCategory();
_menu.findItem(category.getMenuItem()).setChecked(true);
if (_menu != null) {
SortCategory category = _prefs.getCurrentSortCategory();
_menu.findItem(category.getMenuItem()).setChecked(true);
}
}

private void onIntroResult() {
Expand Down Expand Up @@ -908,6 +910,7 @@ protected void onStart() {

handleIncomingIntent();
updateLockIcon();
updateSortCategoryMenu();
doShortcutActions();
updateErrorCard();
}
Expand All @@ -917,14 +920,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
_menu = menu;
getMenuInflater().inflate(R.menu.menu_main, menu);

updateLockIcon();
if (_loaded) {
setGroups(_vaultManager.getVault().getUsedGroups());
updateSortCategoryMenu();
}

MenuItem searchViewMenuItem = menu.findItem(R.id.mi_search);

_searchView = (SearchView) searchViewMenuItem.getActionView();
_searchView.setMaxWidth(Integer.MAX_VALUE);
_searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> {
Expand Down

0 comments on commit 9d383b8

Please sign in to comment.