mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 22:12:55 +00:00
Fix bug where entries didn't get sorted properly
This commit is contained in:
parent
0563ac917a
commit
89a1663e28
1 changed files with 11 additions and 6 deletions
|
@ -153,23 +153,28 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
|
||||||
_shownEntries.add(entry);
|
_shownEntries.add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sortList(_sortCategory);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSortCategory(SortCategory sortCategory) {
|
public void setSortCategory(SortCategory sortCategory) {
|
||||||
if (_sortCategory != sortCategory && sortCategory != SortCategory.CUSTOM) {
|
if (_sortCategory != sortCategory && sortCategory != SortCategory.CUSTOM) {
|
||||||
Collections.sort(_shownEntries, SortCategory.getComparator(sortCategory));
|
sortList(sortCategory);
|
||||||
|
|
||||||
if (SortCategory.isReversed(sortCategory)) {
|
|
||||||
Collections.reverse(_shownEntries);
|
|
||||||
}
|
|
||||||
|
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
_sortCategory = sortCategory;
|
_sortCategory = sortCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sortList(SortCategory sortCategory) {
|
||||||
|
Collections.sort(_shownEntries, SortCategory.getComparator(sortCategory));
|
||||||
|
|
||||||
|
if (SortCategory.isReversed(sortCategory)) {
|
||||||
|
Collections.reverse(_shownEntries);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setViewMode(ViewMode viewMode) {
|
public void setViewMode(ViewMode viewMode) {
|
||||||
_viewMode = viewMode;
|
_viewMode = viewMode;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue