mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-21 14:29:13 +00:00
Don't try to move entries that are filtered out
This fixes a crash that could occur when changing an entry in such a way that it is filtered out from the entry list after the change.
This commit is contained in:
parent
780a215a6b
commit
4bd12f5abe
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
package com.beemdevelopment.aegis.ui.views;
|
package com.beemdevelopment.aegis.ui.views;
|
||||||
|
|
||||||
|
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
|
||||||
|
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
@ -211,7 +213,7 @@ public class EntryAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
|
|
||||||
sortShownEntries();
|
sortShownEntries();
|
||||||
int newPosition = _shownEntries.indexOf(newEntry);
|
int newPosition = _shownEntries.indexOf(newEntry);
|
||||||
if (position != newPosition) {
|
if (newPosition != NO_POSITION && position != newPosition) {
|
||||||
notifyItemMoved(position, newPosition);
|
notifyItemMoved(position, newPosition);
|
||||||
}
|
}
|
||||||
} else if (!isEntryFiltered(newEntry)) {
|
} else if (!isEntryFiltered(newEntry)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue