@Implements(value=android.view.MotionEvent.class) public class ShadowMotionEvent extends java.lang.Object
Shadow of MotionEvent.
The Android framework stores motion events in a pool of native objects. All motion event data is stored natively, and accessed via a series of static native methods following the pattern nativeGetXXXX(mNativePtr, …)
This shadow mirrors this design, but has java equivalents of each native object. Most of the contents of this class were transliterated from oreo-mr1 (SDK 27) frameworks/base/core/jni/android_view_MotionEvent.cpp
Constructor and Description |
---|
ShadowMotionEvent() |
Modifier and Type | Method and Description |
---|---|
protected static void |
nativeAddBatch(int nativePtr,
long eventTimeNanos,
android.view.MotionEvent.PointerCoords[] pointerCoordsObjArray,
int metaState) |
protected static void |
nativeAddBatch(long nativePtr,
long eventTimeNanos,
android.view.MotionEvent.PointerCoords[] pointerCoordsObjArray,
int metaState) |
protected static int |
nativeAxisFromString(java.lang.String label) |
protected static java.lang.String |
nativeAxisToString(int axis) |
protected static int |
nativeCopy(int destNativePtr,
int sourceNativePtr,
boolean keepHistory) |
protected static long |
nativeCopy(long destNativePtr,
long sourceNativePtr,
boolean keepHistory) |
protected static void |
nativeDispose(int nativePtr) |
protected static void |
nativeDispose(long nativePtr) |
protected static int |
nativeFindPointerIndex(int nativePtr,
int pointerId) |
protected static int |
nativeFindPointerIndex(long nativePtr,
int pointerId) |
protected static int |
nativeGetAction(int nativePtr) |
protected static int |
nativeGetAction(long nativePtr) |
protected static int |
nativeGetActionButton(long nativePtr) |
protected static float |
nativeGetAxisValue(int nativePtr,
int axis,
int pointerIndex,
int historyPos) |
protected static float |
nativeGetAxisValue(long nativePtr,
int axis,
int pointerIndex,
int historyPos) |
protected static int |
nativeGetButtonState(int nativePtr) |
protected static int |
nativeGetButtonState(long nativePtr) |
protected static int |
nativeGetDeviceId(int nativePtr) |
protected static int |
nativeGetDeviceId(long nativePtr) |
protected static long |
nativeGetDownTimeNanos(int nativePtr) |
protected static long |
nativeGetDownTimeNanos(long nativePtr) |
protected static int |
nativeGetEdgeFlags(int nativePtr) |
protected static int |
nativeGetEdgeFlags(long nativePtr) |
protected static long |
nativeGetEventTimeNanos(int nativePtr,
int historyPos) |
protected static long |
nativeGetEventTimeNanos(long nativePtr,
int historyPos) |
protected static int |
nativeGetFlags(int nativePtr) |
protected static int |
nativeGetFlags(long nativePtr) |
protected static int |
nativeGetHistorySize(int nativePtr) |
protected static int |
nativeGetHistorySize(long nativePtr) |
protected static int |
nativeGetMetaState(int nativePtr) |
protected static int |
nativeGetMetaState(long nativePtr) |
protected static void |
nativeGetPointerCoords(int nativePtr,
int pointerIndex,
int historyPos,
android.view.MotionEvent.PointerCoords outPointerCoordsObj) |
protected static void |
nativeGetPointerCoords(long nativePtr,
int pointerIndex,
int historyPos,
android.view.MotionEvent.PointerCoords outPointerCoordsObj) |
protected static int |
nativeGetPointerCount(int nativePtr) |
protected static int |
nativeGetPointerCount(long nativePtr) |
protected static int |
nativeGetPointerId(int nativePtr,
int pointerIndex) |
protected static int |
nativeGetPointerId(long nativePtr,
int pointerIndex) |
protected static void |
nativeGetPointerProperties(int nativePtr,
int pointerIndex,
android.view.MotionEvent.PointerProperties outPointerPropertiesObj) |
protected static void |
nativeGetPointerProperties(long nativePtr,
int pointerIndex,
android.view.MotionEvent.PointerProperties outPointerPropertiesObj) |
protected static float |
nativeGetRawAxisValue(int nativePtr,
int axis,
int pointerIndex,
int historyPos) |
protected static float |
nativeGetRawAxisValue(long nativePtr,
int axis,
int pointerIndex,
int historyPos) |
protected static int |
nativeGetSource(int nativePtr) |
protected static int |
nativeGetSource(long nativePtr) |
protected static int |
nativeGetToolType(int nativePtr,
int pointerIndex) |
protected static int |
nativeGetToolType(long nativePtr,
int pointerIndex) |
protected static float |
nativeGetXOffset(int nativePtr) |
protected static float |
nativeGetXOffset(long nativePtr) |
protected static float |
nativeGetXPrecision(int nativePtr) |
protected static float |
nativeGetXPrecision(long nativePtr) |
protected static float |
nativeGetYOffset(int nativePtr) |
protected static float |
nativeGetYOffset(long nativePtr) |
protected static float |
nativeGetYPrecision(int nativePtr) |
protected static float |
nativeGetYPrecision(long nativePtr) |
protected static int |
nativeInitialize(int nativePtr,
int deviceId,
int source,
int action,
int flags,
int edgeFlags,
int metaState,
int buttonState,
float xOffset,
float yOffset,
float xPrecision,
float yPrecision,
long downTimeNanos,
long eventTimeNanos,
int pointerCount,
android.view.MotionEvent.PointerProperties[] pointerIds,
android.view.MotionEvent.PointerCoords[] pointerCoords) |
protected static long |
nativeInitialize(long nativePtr,
int deviceId,
int source,
int action,
int flags,
int edgeFlags,
int metaState,
int buttonState,
float xOffset,
float yOffset,
float xPrecision,
float yPrecision,
long downTimeNanos,
long eventTimeNanos,
int pointerCount,
android.view.MotionEvent.PointerProperties[] pointerPropertiesObjArray,
android.view.MotionEvent.PointerCoords[] pointerCoordsObjArray) |
protected static boolean |
nativeIsTouchEvent(int nativePtr) |
protected static boolean |
nativeIsTouchEvent(long nativePtr) |
protected static void |
nativeOffsetLocation(int nativePtr,
float deltaX,
float deltaY) |
protected static void |
nativeOffsetLocation(long nativePtr,
float deltaX,
float deltaY) |
protected static int |
nativeReadFromParcel(int nativePtr,
android.os.Parcel parcelObj) |
protected static long |
nativeReadFromParcel(long nativePtr,
android.os.Parcel parcelObj) |
protected static void |
nativeScale(int nativePtr,
float scale) |
protected static void |
nativeScale(long nativePtr,
float scale) |
protected static void |
nativeSetAction(int nativePtr,
int action) |
protected static void |
nativeSetAction(long nativePtr,
int action) |
protected static void |
nativeSetActionButton(long nativePtr,
int button) |
protected static void |
nativeSetButtonState(long nativePtr,
int buttonState) |
protected static void |
nativeSetDownTimeNanos(int nativePtr,
long downTimeNanos) |
protected static void |
nativeSetDownTimeNanos(long nativePtr,
long downTimeNanos) |
protected static void |
nativeSetEdgeFlags(int nativePtr,
int edgeFlags) |
protected static void |
nativeSetEdgeFlags(long nativePtr,
int edgeFlags) |
protected static void |
nativeSetFlags(int nativePtr,
int flags) |
protected static void |
nativeSetFlags(long nativePtr,
int flags) |
protected static int |
nativeSetSource(int nativePtr,
int source) |
protected static void |
nativeSetSource(long nativePtr,
int source) |
protected static void |
nativeWriteToParcel(int nativePtr,
android.os.Parcel parcel) |
protected static void |
nativeWriteToParcel(long nativePtr,
android.os.Parcel parcel) |
static void |
reset() |
android.view.MotionEvent |
setPointer2(float pointer1X,
float pointer1Y)
Deprecated.
use
MotionEvent.obtain() or androidx.test.core.view.MotionEventBuilder to create a MotionEvent with desired data. |
void |
setPointerIds(int index0PointerId,
int index1PointerId)
Deprecated.
use
MotionEvent.obtain() or MotionEventBuilder to create a MotionEvent with desired data |
void |
setPointerIndex(int pointerIndex)
Deprecated.
use
MotionEvent.obtain() or androidx.test.core.view.MotionEventBuilder#setPointerAction(int, int) to create a MotionEvent with desired data. |
protected void |
transform(android.graphics.Matrix matrix) |
@Resetter public static void reset()
@Implementation(maxSdk=20) @HiddenApi protected static int nativeInitialize(int nativePtr, int deviceId, int source, int action, int flags, int edgeFlags, int metaState, int buttonState, float xOffset, float yOffset, float xPrecision, float yPrecision, long downTimeNanos, long eventTimeNanos, int pointerCount, android.view.MotionEvent.PointerProperties[] pointerIds, android.view.MotionEvent.PointerCoords[] pointerCoords)
@Implementation(minSdk=21, maxSdk=28) @HiddenApi protected static long nativeInitialize(long nativePtr, int deviceId, int source, int action, int flags, int edgeFlags, int metaState, int buttonState, float xOffset, float yOffset, float xPrecision, float yPrecision, long downTimeNanos, long eventTimeNanos, int pointerCount, android.view.MotionEvent.PointerProperties[] pointerPropertiesObjArray, android.view.MotionEvent.PointerCoords[] pointerCoordsObjArray)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeDispose(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static void nativeDispose(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeAddBatch(int nativePtr, long eventTimeNanos, android.view.MotionEvent.PointerCoords[] pointerCoordsObjArray, int metaState)
@Implementation(minSdk=21) @HiddenApi protected static void nativeAddBatch(long nativePtr, long eventTimeNanos, android.view.MotionEvent.PointerCoords[] pointerCoordsObjArray, int metaState)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeGetPointerCoords(int nativePtr, int pointerIndex, int historyPos, android.view.MotionEvent.PointerCoords outPointerCoordsObj)
@Implementation(minSdk=21) @HiddenApi protected static void nativeGetPointerCoords(long nativePtr, int pointerIndex, int historyPos, android.view.MotionEvent.PointerCoords outPointerCoordsObj)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeGetPointerProperties(int nativePtr, int pointerIndex, android.view.MotionEvent.PointerProperties outPointerPropertiesObj)
@Implementation(minSdk=21) @HiddenApi protected static void nativeGetPointerProperties(long nativePtr, int pointerIndex, android.view.MotionEvent.PointerProperties outPointerPropertiesObj)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeReadFromParcel(int nativePtr, android.os.Parcel parcelObj)
@Implementation(minSdk=21) @HiddenApi protected static long nativeReadFromParcel(long nativePtr, android.os.Parcel parcelObj)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeWriteToParcel(int nativePtr, android.os.Parcel parcel)
@Implementation(minSdk=21) @HiddenApi protected static void nativeWriteToParcel(long nativePtr, android.os.Parcel parcel)
@Implementation(minSdk=21) @HiddenApi protected static java.lang.String nativeAxisToString(int axis)
@Implementation(minSdk=21) @HiddenApi protected static int nativeAxisFromString(java.lang.String label)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetPointerId(int nativePtr, int pointerIndex)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetPointerId(long nativePtr, int pointerIndex)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetToolType(int nativePtr, int pointerIndex)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetToolType(long nativePtr, int pointerIndex)
@Implementation(maxSdk=20) @HiddenApi protected static long nativeGetEventTimeNanos(int nativePtr, int historyPos)
@Implementation(minSdk=21) @HiddenApi protected static long nativeGetEventTimeNanos(long nativePtr, int historyPos)
@Implementation(maxSdk=20) @HiddenApi protected static float nativeGetRawAxisValue(int nativePtr, int axis, int pointerIndex, int historyPos)
@Implementation(minSdk=21) @HiddenApi protected static float nativeGetRawAxisValue(long nativePtr, int axis, int pointerIndex, int historyPos)
@Implementation(maxSdk=20) @HiddenApi protected static float nativeGetAxisValue(int nativePtr, int axis, int pointerIndex, int historyPos)
@Implementation(minSdk=21) @HiddenApi protected static float nativeGetAxisValue(long nativePtr, int axis, int pointerIndex, int historyPos)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeCopy(int destNativePtr, int sourceNativePtr, boolean keepHistory)
@Implementation(minSdk=21) @HiddenApi protected static long nativeCopy(long destNativePtr, long sourceNativePtr, boolean keepHistory)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetDeviceId(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetDeviceId(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetSource(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetSource(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeSetSource(int nativePtr, int source)
@Implementation(minSdk=21) @HiddenApi protected static void nativeSetSource(long nativePtr, int source)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetAction(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetAction(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeSetAction(int nativePtr, int action)
@Implementation(minSdk=21) @HiddenApi protected static void nativeSetAction(long nativePtr, int action)
@Implementation(minSdk=23) @HiddenApi protected static int nativeGetActionButton(long nativePtr)
@Implementation(minSdk=23) @HiddenApi protected static void nativeSetActionButton(long nativePtr, int button)
@Implementation(maxSdk=20) @HiddenApi protected static boolean nativeIsTouchEvent(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static boolean nativeIsTouchEvent(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetFlags(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetFlags(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeSetFlags(int nativePtr, int flags)
@Implementation(minSdk=21) @HiddenApi protected static void nativeSetFlags(long nativePtr, int flags)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetEdgeFlags(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetEdgeFlags(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeSetEdgeFlags(int nativePtr, int edgeFlags)
@Implementation(minSdk=21) @HiddenApi protected static void nativeSetEdgeFlags(long nativePtr, int edgeFlags)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetMetaState(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetMetaState(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetButtonState(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetButtonState(long nativePtr)
@Implementation(minSdk=23) @HiddenApi protected static void nativeSetButtonState(long nativePtr, int buttonState)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeOffsetLocation(int nativePtr, float deltaX, float deltaY)
@Implementation(minSdk=21) @HiddenApi protected static void nativeOffsetLocation(long nativePtr, float deltaX, float deltaY)
@Implementation(maxSdk=20) @HiddenApi protected static float nativeGetXOffset(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static float nativeGetXOffset(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static float nativeGetYOffset(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static float nativeGetYOffset(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static float nativeGetXPrecision(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static float nativeGetXPrecision(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static float nativeGetYPrecision(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static float nativeGetYPrecision(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static long nativeGetDownTimeNanos(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static long nativeGetDownTimeNanos(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeSetDownTimeNanos(int nativePtr, long downTimeNanos)
@Implementation(minSdk=21) @HiddenApi protected static void nativeSetDownTimeNanos(long nativePtr, long downTimeNanos)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetPointerCount(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetPointerCount(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeFindPointerIndex(int nativePtr, int pointerId)
@Implementation(minSdk=21) @HiddenApi protected static int nativeFindPointerIndex(long nativePtr, int pointerId)
@Implementation(maxSdk=20) @HiddenApi protected static int nativeGetHistorySize(int nativePtr)
@Implementation(minSdk=21) @HiddenApi protected static int nativeGetHistorySize(long nativePtr)
@Implementation(maxSdk=20) @HiddenApi protected static void nativeScale(int nativePtr, float scale)
@Implementation(minSdk=21) @HiddenApi protected static void nativeScale(long nativePtr, float scale)
@Implementation protected final void transform(android.graphics.Matrix matrix)
@Deprecated public android.view.MotionEvent setPointer2(float pointer1X, float pointer1Y)
MotionEvent.obtain()
or androidx.test.core.view.MotionEventBuilder
to create a MotionEvent with desired data.@Deprecated public void setPointerIndex(int pointerIndex)
MotionEvent.obtain()
or androidx.test.core.view.MotionEventBuilder#setPointerAction(int, int)
to create a MotionEvent with desired data.@Deprecated public void setPointerIds(int index0PointerId, int index1PointerId)
MotionEvent.obtain()
or MotionEventBuilder
to create a MotionEvent with desired data