From d1a1ba8279f98c2edcc7fd9adcbb6cfc63759b91 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 26 Jun 2020 16:50:27 +0200 Subject: [PATCH] Fixed swipe selection on data changed --- .../selection/DefaultSelectionTracker.java | 2 +- ...ew-selection.patch => SelectionTracker.patch} | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) rename patches/{recyclerview-selection.patch => SelectionTracker.patch} (83%) diff --git a/app/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java b/app/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java index 7093084825..8f564e44b2 100644 --- a/app/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java +++ b/app/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java @@ -394,7 +394,7 @@ public class DefaultSelectionTracker extends SelectionTracker implements R @SuppressWarnings({"WeakerAccess", "unchecked"}) /* synthetic access */ void onDataSetChanged() { - mSelection.clearProvisionalSelection(); + //mSelection.clearProvisionalSelection(); notifySelectionRefresh(); diff --git a/patches/recyclerview-selection.patch b/patches/SelectionTracker.patch similarity index 83% rename from patches/recyclerview-selection.patch rename to patches/SelectionTracker.patch index 1a2290d6ce..9fdbb5b11c 100644 --- a/patches/recyclerview-selection.patch +++ b/patches/SelectionTracker.patch @@ -1,6 +1,5 @@ -diff -rupN /home/marcel/support/recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java app/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java --- /home/marcel/support/recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java 2020-03-23 17:03:46.043122318 +0100 -+++ app/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java 2020-04-24 21:08:55.542011257 +0200 ++++ app/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java 2020-06-26 16:48:04.938298254 +0200 @@ -379,6 +379,10 @@ public class DefaultSelectionTracker return mRange != null; } @@ -12,6 +11,15 @@ diff -rupN /home/marcel/support/recyclerview/recyclerview-selection/src/main/jav private boolean canSetState(@NonNull K key, boolean nextState) { return mSelectionPredicate.canSetStateForKey(key, nextState); } +@@ -390,7 +394,7 @@ public class DefaultSelectionTracker + + @SuppressWarnings({"WeakerAccess", "unchecked"}) /* synthetic access */ + void onDataSetChanged() { +- mSelection.clearProvisionalSelection(); ++ //mSelection.clearProvisionalSelection(); + + notifySelectionRefresh(); + @@ -601,17 +605,21 @@ public class DefaultSelectionTracker @Override @@ -37,9 +45,8 @@ diff -rupN /home/marcel/support/recyclerview/recyclerview-selection/src/main/jav } } } -diff -rupN /home/marcel/support/recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/Range.java app/src/main/java/androidx/recyclerview/selection/Range.java --- /home/marcel/support/recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/Range.java 2020-03-23 17:03:46.045122318 +0100 -+++ app/src/main/java/androidx/recyclerview/selection/Range.java 2020-04-24 21:08:55.543011257 +0200 ++++ app/src/main/java/androidx/recyclerview/selection/Range.java 2020-06-26 16:36:39.708283142 +0200 @@ -169,6 +169,11 @@ final class Range { mCallbacks.updateForRange(begin, end, selected, type); } @@ -52,7 +59,6 @@ diff -rupN /home/marcel/support/recyclerview/recyclerview-selection/src/main/jav @Override public String toString() { return "Range{begin=" + mBegin + ", end=" + mEnd + "}"; -diff -rupN /home/marcel/support/recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/SelectionTracker.java app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java --- /home/marcel/support/recyclerview/recyclerview-selection/src/main/java/androidx/recyclerview/selection/SelectionTracker.java 2020-03-23 17:03:46.046122318 +0100 +++ app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java 2020-04-24 21:08:55.544011257 +0200 @@ -503,7 +503,7 @@ public abstract class SelectionTracker