summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorVishnu Nair <vishnun@google.com>2018-12-14 01:04:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-12-14 01:04:53 +0000
commitf85dddfd0cf98d1593101d479ac4ba2b006eb4f0 (patch)
tree0f55060f47bf112bd808345e2ed3d71ef69c8a92 /core/java
parent9c5585943f4e5ad26fc5a04e790fe4dc2b53ce6b (diff)
parent1899955c1c273d87388830f312c341e966c31e03 (diff)
Merge "Pip: Use raw input coordiates when calculating pip movement offsets"
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/MotionEvent.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index b59d8c720b9d..a86abe517b6a 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -2588,6 +2588,38 @@ public final class MotionEvent extends InputEvent implements Parcelable {
}
/**
+ * Returns the original raw X coordinate of this event. For touch
+ * events on the screen, this is the original location of the event
+ * on the screen, before it had been adjusted for the containing window
+ * and views.
+ *
+ * @param pointerIndex Raw index of pointer to retrieve. Value may be from 0
+ * (the first pointer that is down) to {@link #getPointerCount()}-1.
+ *
+ * @see #getX(int)
+ * @see #AXIS_X
+ */
+ public float getRawX(int pointerIndex) {
+ return nativeGetRawAxisValue(mNativePtr, AXIS_X, pointerIndex, HISTORY_CURRENT);
+ }
+
+ /**
+ * Returns the original raw Y coordinate of this event. For touch
+ * events on the screen, this is the original location of the event
+ * on the screen, before it had been adjusted for the containing window
+ * and views.
+ *
+ * @param pointerIndex Raw index of pointer to retrieve. Value may be from 0
+ * (the first pointer that is down) to {@link #getPointerCount()}-1.
+ *
+ * @see #getY(int)
+ * @see #AXIS_Y
+ */
+ public float getRawY(int pointerIndex) {
+ return nativeGetRawAxisValue(mNativePtr, AXIS_Y, pointerIndex, HISTORY_CURRENT);
+ }
+
+ /**
* Return the precision of the X coordinates being reported. You can
* multiply this number with {@link #getX} to find the actual hardware
* value of the X coordinate.