Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sort category radio button state in the menu #1533

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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