mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-24 05:46:14 +03:00
Fix #1308 Crash when long pressing a note and swiping to the edge of the screen
Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
parent
119fced969
commit
a9fb6f12ba
3 changed files with 10 additions and 1 deletions
|
@ -170,6 +170,10 @@ public class ItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> i
|
|||
return itemList.get(notePosition);
|
||||
}
|
||||
|
||||
public boolean hasItemPosition(int notePosition) {
|
||||
return notePosition >= 0 && notePosition < itemList.size();
|
||||
}
|
||||
|
||||
public void remove(@NonNull Item item) {
|
||||
itemList.remove(item);
|
||||
notifyDataSetChanged();
|
||||
|
|
|
@ -31,7 +31,10 @@ public class ItemSelectionTracker {
|
|||
@Override
|
||||
public boolean canSetStateAtPosition(int position, boolean nextState) {
|
||||
@Nullable Integer swipedPosition = adapter.getSwipedPosition();
|
||||
return !adapter.getItem(position).isSection() && (swipedPosition == null || swipedPosition != position);
|
||||
if (!adapter.hasItemPosition(position)) {
|
||||
return false;
|
||||
}
|
||||
return (swipedPosition == null || swipedPosition != position) && !adapter.getItem(position).isSection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
2
fastlane/metadata/android/en-US/changelogs/3004013.txt
Normal file
2
fastlane/metadata/android/en-US/changelogs/3004013.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
- 🐞 Fix potential crash when rendering a note with a checkbox (#1326) - by @pbek
|
||||
- 🐞 Fix crash when long pressing a note and swiping to the edge of the screen (#1308)
|
Loading…
Reference in a new issue