mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-23 07:19:13 +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);
|
||||
if (_sortCategory != null) {
|
||||
Comparator<VaultEntry> comparator = _sortCategory.getComparator();
|
||||
Collections.sort(_shownEntries, comparator);
|
||||
int newPosition = Collections.binarySearch(_shownEntries, newEntry, comparator);
|
||||
if (position != newPosition) {
|
||||
notifyItemMoved(position, newPosition);
|
||||
if (comparator != null) {
|
||||
Collections.sort(_shownEntries, comparator);
|
||||
int newPosition = Collections.binarySearch(_shownEntries, newEntry, comparator);
|
||||
if (position != newPosition) {
|
||||
notifyItemMoved(position, newPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue