Reflect changes in the group list to the group filter

Fixes #723
This commit is contained in:
Alexander Bakker 2021-05-07 18:08:39 +02:00
parent 1eff91594f
commit c3c4e1fb4b
2 changed files with 10 additions and 1 deletions

View file

@ -77,7 +77,6 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
private AegisApplication _app;
private VaultManager _vault;
private boolean _loaded;
private List<String> _selectedGroups;
private boolean _searchSubmitted;
private boolean _isAuthenticating;

View file

@ -420,6 +420,16 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
_groups = groups;
_groupChip.setVisibility(_groups.isEmpty() ? View.GONE : View.VISIBLE);
updateDividerDecoration();
if (_groupFilter != null) {
List<String> groupFilter = _groupFilter.stream()
.filter(g -> _groups.contains(g))
.collect(Collectors.toList());
if (!_groupFilter.equals(groupFilter)) {
setGroupFilter(groupFilter, true);
}
}
}
private void updateDividerDecoration() {