mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-24 15:56:07 +00:00
Add way to check for reversed sort categories
This commit is contained in:
parent
09fe550a28
commit
62025d1053
2 changed files with 14 additions and 3 deletions
|
@ -26,4 +26,16 @@ public enum SortCategory {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isReversed(SortCategory sortCategory) {
|
||||
switch(sortCategory)
|
||||
{
|
||||
case ACCOUNTREVERSED:
|
||||
case ISSUERREVERSED:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,12 +155,11 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
|
|||
}
|
||||
|
||||
public void setSortCategory(SortCategory sortCategory) {
|
||||
if (_sortCategory != sortCategory)
|
||||
{
|
||||
if (_sortCategory != sortCategory) {
|
||||
_sortCategory = sortCategory;
|
||||
Collections.sort(_shownEntries, new IssuerNameComparator());
|
||||
|
||||
if(sortCategory == SortCategory.ACCOUNTREVERSED || sortCategory == SortCategory.ISSUERREVERSED)
|
||||
if(SortCategory.isReversed(sortCategory))
|
||||
{
|
||||
Collections.reverse(_shownEntries);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue