Fix call to notifyItemMoved when entry change causes sort change

This fixes an issue introduced in ffcbaffcfc
This commit is contained in:
Alexander Bakker 2022-11-02 15:09:42 +01:00
parent 0ee74bfeb2
commit c27d080a11

View file

@ -223,7 +223,7 @@ public class EntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
Comparator<VaultEntry> comparator = _sortCategory.getComparator();
if (comparator != null) {
Collections.sort(_shownEntries, comparator);
int newPosition = Collections.binarySearch(_shownEntries, newEntry, comparator);
int newPosition = _shownEntries.indexOf(newEntry);
if (position != newPosition) {
notifyItemMoved(position, newPosition);
}