1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 02:37:16 +00:00
FairEmail/recyclerview-selection.patch

43 lines
2.2 KiB
Diff
Raw Normal View History

2019-05-09 13:12:47 +00:00
diff --git a/app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java b/app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
2019-06-07 06:48:03 +00:00
index 76087ea4..121fbd14 100644
2019-05-09 13:12:47 +00:00
--- a/app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
+++ b/app/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
2019-06-07 06:48:03 +00:00
@@ -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> {
2019-05-09 13:12:47 +00:00
@Override
public void run() {
2019-06-07 06:48:03 +00:00
if (mSelectionPredicate.canSelectMultiple()) {
- gestureHelper.start();
2019-05-09 13:12:47 +00:00
+ try {
+ gestureHelper.start();
+ } catch (IllegalStateException ex) {
+ ex.printStackTrace();
+ }
2019-06-07 06:48:03 +00:00
}
2019-05-09 13:12:47 +00:00
}
},
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.");