Add ungrouped filter

pull/214/head
Michael Schättgen 6 years ago
parent a88d1cf11e
commit 9f075e7bc6

@ -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) {

@ -143,6 +143,7 @@
<string name="progressbar_error">Unable to reset animator duration scale. Progress bars will be invisible.</string>
<string name="details">Details</string>
<string name="filter">Filter</string>
<string name="filter_ungrouped">Ungrouped</string>
<string name="lock">Lock</string>
<string name="all">All</string>
<string name="name">Name</string>

Loading…
Cancel
Save