Fix bug where entries didn't get sorted properly

This commit is contained in:
Michael Schättgen 2019-04-09 17:15:25 +02:00
parent 0563ac917a
commit 89a1663e28

View file

@ -153,21 +153,26 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
_shownEntries.add(entry);
}
}
sortList(_sortCategory);
notifyDataSetChanged();
}
public void setSortCategory(SortCategory sortCategory) {
if (_sortCategory != sortCategory && sortCategory != SortCategory.CUSTOM) {
sortList(sortCategory);
notifyDataSetChanged();
}
_sortCategory = sortCategory;
}
private void sortList(SortCategory sortCategory) {
Collections.sort(_shownEntries, SortCategory.getComparator(sortCategory));
if (SortCategory.isReversed(sortCategory)) {
Collections.reverse(_shownEntries);
}
notifyDataSetChanged();
}
_sortCategory = sortCategory;
}
public void setViewMode(ViewMode viewMode) {