FairEmail/recyclerview-selection.patch

43 lines
2.2 KiB
Diff

diff --git a/app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java b/app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
index 76087ea4..121fbd14 100644
--- a/app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
+++ b/app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
@@ -488,7 +488,7 @@ public abstract class SelectionTracker<K> {
private OnContextClickListener mOnContextClickListener;
private BandPredicate mBandPredicate;
- private int mBandOverlayId = R.drawable.selection_band_overlay;
+ private int mBandOverlayId = eu.faircode.email.R.drawable.selection_band_overlay;
private int[] mGestureToolTypes = new int[] {
MotionEvent.TOOL_TYPE_FINGER,
@@ -766,7 +766,11 @@ public abstract class SelectionTracker<K> {
@Override
public void run() {
if (mSelectionPredicate.canSelectMultiple()) {
- gestureHelper.start();
+ try {
+ gestureHelper.start();
+ } catch (IllegalStateException ex) {
+ ex.printStackTrace();
+ }
}
}
},
diff --git a/app/src/main/java/androidx/recyclerview/selection/TouchInputHandler.java b/app/src/main/java/androidx/recyclerview/selection/TouchInputHandler.java
index d82812cc..48db78ec 100644
--- a/app/src/main/java/androidx/recyclerview/selection/TouchInputHandler.java
+++ b/app/src/main/java/androidx/recyclerview/selection/TouchInputHandler.java
@@ -107,6 +107,11 @@ final class TouchInputHandler<K> extends MotionInputHandler<K> {
}
@Override
+ public boolean onDoubleTapEvent(MotionEvent e) {
+ return mSelectionTracker.hasSelection();
+ }
+
+ @Override
public void onLongPress(@NonNull MotionEvent e) {
if (!mDetailsLookup.overItemWithSelectionKey(e)) {
if (DEBUG) Log.d(TAG, "Ignoring LongPress on non-model-backed item.");