mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-06-08 07:37:44 +00:00
Only re-sort entry list when not using custom sorting
This fixes a crash introduced in #910.
This commit is contained in:
parent
11d7493245
commit
1373a67ea0
1 changed files with 6 additions and 4 deletions
|
@ -194,10 +194,12 @@ public class EntryAdapter extends RecyclerView.Adapter<EntryHolder> implements I
|
||||||
notifyItemChanged(position);
|
notifyItemChanged(position);
|
||||||
if (_sortCategory != null) {
|
if (_sortCategory != null) {
|
||||||
Comparator<VaultEntry> comparator = _sortCategory.getComparator();
|
Comparator<VaultEntry> comparator = _sortCategory.getComparator();
|
||||||
Collections.sort(_shownEntries, comparator);
|
if (comparator != null) {
|
||||||
int newPosition = Collections.binarySearch(_shownEntries, newEntry, comparator);
|
Collections.sort(_shownEntries, comparator);
|
||||||
if (position != newPosition) {
|
int newPosition = Collections.binarySearch(_shownEntries, newEntry, comparator);
|
||||||
notifyItemMoved(position, newPosition);
|
if (position != newPosition) {
|
||||||
|
notifyItemMoved(position, newPosition);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue