summaryrefslogtreecommitdiff
path: root/androidx/recyclerview/selection/MotionEvents.java
diff options
context:
space:
mode:
Diffstat (limited to 'androidx/recyclerview/selection/MotionEvents.java')
-rw-r--r--androidx/recyclerview/selection/MotionEvents.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/androidx/recyclerview/selection/MotionEvents.java b/androidx/recyclerview/selection/MotionEvents.java
index 90d79e64..bc47a76c 100644
--- a/androidx/recyclerview/selection/MotionEvents.java
+++ b/androidx/recyclerview/selection/MotionEvents.java
@@ -104,6 +104,16 @@ final class MotionEvents {
return isMouseEvent(e) && isActionMove(e) && e.getButtonState() == 0;
}
+ /**
+ * Returns true if the event is a drag event (which is presumbaly, but not
+ * explicitly required to be a mouse event).
+ * @param e
+ */
+ static boolean isPointerDragEvent(MotionEvent e) {
+ return isPrimaryMouseButtonPressed(e)
+ && isActionMove(e);
+ }
+
private static boolean hasBit(int metaState, int bit) {
return (metaState & bit) != 0;
}