mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-04 20:30:36 +00:00
Add ungrouped filter
This commit is contained in:
parent
a88d1cf11e
commit
9f075e7bc6
3 changed files with 14 additions and 2 deletions
|
@ -333,6 +333,10 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
}
|
||||
}
|
||||
|
||||
if (groups.size() > 0) {
|
||||
menu.add(R.id.action_filter_group, Menu.NONE, 10, R.string.filter_ungrouped);
|
||||
}
|
||||
|
||||
menu.setGroupCheckable(R.id.action_filter_group, true, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.beemdevelopment.aegis.R;
|
||||
import com.beemdevelopment.aegis.SortCategory;
|
||||
import com.beemdevelopment.aegis.ViewMode;
|
||||
import com.beemdevelopment.aegis.db.DatabaseEntry;
|
||||
|
@ -158,8 +159,14 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
|
|||
String issuer = entry.getIssuer().toLowerCase();
|
||||
String name = entry.getName().toLowerCase();
|
||||
|
||||
if (_groupFilter != null && (group == null || !group.equals(_groupFilter))) {
|
||||
return true;
|
||||
if (_groupFilter != null) {
|
||||
if (group == null && _groupFilter.equals(_view.getContext().getString(R.string.filter_ungrouped))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (group == null || !group.equals(_groupFilter)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (_searchFilter == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue