FairEmail/patches/recyclerview-selection.patch

43 lines
2.1 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-12-08 18:33:02 +00:00
index 50cc4ceb7..910935a0a 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-12-08 18:33:02 +00:00
@@ -503,7 +503,7 @@ public abstract class SelectionTracker<K> {
2019-06-07 06:48:03 +00:00
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;
2019-12-08 18:33:02 +00:00
// TODO(b/144500333): Remove support for overriding gesture and pointer tooltypes.
private int[] mGestureToolTypes = new int[]{
@@ -815,7 +815,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();
2019-12-08 18:33:02 +00:00
+ } catch (Throwable ex) {
+ eu.faircode.email.Log.e(ex);
2019-05-09 13:12:47 +00:00
+ }
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
2019-12-08 18:33:02 +00:00
index be4c3fa0b..c434ced07 100644
2019-05-09 13:12:47 +00:00
--- a/app/src/main/java/androidx/recyclerview/selection/TouchInputHandler.java
+++ b/app/src/main/java/androidx/recyclerview/selection/TouchInputHandler.java
2019-12-08 18:33:02 +00:00
@@ -112,6 +112,11 @@ final class TouchInputHandler<K> extends MotionInputHandler<K> {
2019-05-09 13:12:47 +00:00
}
@Override
+ public boolean onDoubleTapEvent(MotionEvent e) {
+ return mSelectionTracker.hasSelection();
+ }
+
+ @Override
public void onLongPress(@NonNull MotionEvent e) {
2019-12-08 18:33:02 +00:00
if (DEBUG) {
checkArgument(MotionEvents.isFingerEvent(e));