MotionEventCompat
class MotionEventCompat
Helper for accessing features in MotionEvent.
Summary
Constants |
|
|---|---|
const Int |
This property is deprecated. Use |
const Int |
ACTION_HOVER_EXIT = 10This property is deprecated. Use |
const Int |
This property is deprecated. Use |
const Int |
ACTION_MASK = 255This property is deprecated. Use |
const Int |
This property is deprecated. Use |
const Int |
ACTION_POINTER_INDEX_MASK = 65280This property is deprecated. Use |
const Int |
This property is deprecated. Use |
const Int |
This property is deprecated. Use |
const Int |
ACTION_SCROLL = 8This property is deprecated. Use |
const Int |
AXIS_BRAKE = 23This property is deprecated. Use |
const Int |
AXIS_DISTANCE = 24This property is deprecated. Use |
const Int |
AXIS_GAS = 22This property is deprecated. Use |
const Int |
AXIS_GENERIC_1 = 32This property is deprecated. Use |
const Int |
AXIS_GENERIC_10 = 41This property is deprecated. Use |
const Int |
AXIS_GENERIC_11 = 42This property is deprecated. Use |
const Int |
AXIS_GENERIC_12 = 43This property is deprecated. Use |
const Int |
AXIS_GENERIC_13 = 44This property is deprecated. Use |
const Int |
AXIS_GENERIC_14 = 45This property is deprecated. Use |
const Int |
AXIS_GENERIC_15 = 46This property is deprecated. Use |
const Int |
AXIS_GENERIC_16 = 47This property is deprecated. Use |
const Int |
AXIS_GENERIC_2 = 33This property is deprecated. Use |
const Int |
AXIS_GENERIC_3 = 34This property is deprecated. Use |
const Int |
AXIS_GENERIC_4 = 35This property is deprecated. Use |
const Int |
AXIS_GENERIC_5 = 36This property is deprecated. Use |
const Int |
AXIS_GENERIC_6 = 37This property is deprecated. Use |
const Int |
AXIS_GENERIC_7 = 38This property is deprecated. Use |
const Int |
AXIS_GENERIC_8 = 39This property is deprecated. Use |
const Int |
AXIS_GENERIC_9 = 40This property is deprecated. Use |
const Int |
AXIS_HAT_X = 15This property is deprecated. Use |
const Int |
AXIS_HAT_Y = 16This property is deprecated. Use |
const Int |
AXIS_HSCROLL = 10This property is deprecated. Use |
const Int |
AXIS_LTRIGGER = 17This property is deprecated. Use |
const Int |
AXIS_ORIENTATION = 8This property is deprecated. Use |
const Int |
AXIS_PRESSURE = 2This property is deprecated. Use |
const Int |
AXIS_RELATIVE_X = 27Synonym for |
const Int |
AXIS_RELATIVE_Y = 28Synonym for |
const Int |
AXIS_RTRIGGER = 18This property is deprecated. Use |
const Int |
AXIS_RUDDER = 20This property is deprecated. Use |
const Int |
AXIS_RX = 12This property is deprecated. Use |
const Int |
AXIS_RY = 13This property is deprecated. Use |
const Int |
AXIS_RZ = 14This property is deprecated. Use |
const Int |
AXIS_SCROLL = 26Synonym for |
const Int |
AXIS_SIZE = 3This property is deprecated. Use |
const Int |
AXIS_THROTTLE = 19This property is deprecated. Use |
const Int |
AXIS_TILT = 25This property is deprecated. Use |
const Int |
AXIS_TOOL_MAJOR = 6This property is deprecated. Use |
const Int |
AXIS_TOOL_MINOR = 7This property is deprecated. Use |
const Int |
AXIS_TOUCH_MAJOR = 4This property is deprecated. Use |
const Int |
AXIS_TOUCH_MINOR = 5This property is deprecated. Use |
const Int |
AXIS_VSCROLL = 9This property is deprecated. Use |
const Int |
AXIS_WHEEL = 21This property is deprecated. Use |
const Int |
AXIS_X = 0This property is deprecated. Use |
const Int |
AXIS_Y = 1This property is deprecated. Use |
const Int |
AXIS_Z = 11This property is deprecated. Use |
const Int |
BUTTON_PRIMARY = 1This property is deprecated. Use |
Public functions |
|
|---|---|
java-static Int |
@ReplaceWith(expression = "event.findPointerIndex(pointerId)")This function is deprecated. Call |
java-static Int |
@ReplaceWith(expression = "event.getActionIndex()")This function is deprecated. Call |
java-static Int |
@ReplaceWith(expression = "event.getActionMasked()")This function is deprecated. Call |
java-static Float |
@ReplaceWith(expression = "event.getAxisValue(axis)")This function is deprecated. Call |
java-static Float |
@ReplaceWith(expression = "event.getAxisValue(axis, pointerIndex)")This function is deprecated. Call |
java-static Int |
@ReplaceWith(expression = "event.getButtonState()")This function is deprecated. Call |
java-static Int |
@ReplaceWith(expression = "event.getPointerCount()")This function is deprecated. Call |
java-static Int |
@ReplaceWith(expression = "event.getPointerId(pointerIndex)")This function is deprecated. Call |
java-static Int |
@ReplaceWith(expression = "event.getSource()")This function is deprecated. Call |
java-static Float |
@ReplaceWith(expression = "event.getX(pointerIndex)")This function is deprecated. Call |
java-static Float |
@ReplaceWith(expression = "event.getY(pointerIndex)")This function is deprecated. Call |
java-static Boolean |
isFromSource(event: MotionEvent, source: Int)Determines whether the event is from the given source. |
Constants
Public functions
@ReplaceWith(expression = "event.findPointerIndex(pointerId)")
java-static funfindPointerIndex(event: MotionEvent!, pointerId: Int): Int
Call findPointerIndex.
@ReplaceWith(expression = "event.getActionIndex()")
java-static fungetActionIndex(event: MotionEvent!): Int
Call getAction, returning only the pointer index portion.
@ReplaceWith(expression = "event.getActionMasked()")
java-static fungetActionMasked(event: MotionEvent!): Int
Call getAction, returning only the ACTION_MASK portion.
@ReplaceWith(expression = "event.getAxisValue(axis)")
java-static fungetAxisValue(event: MotionEvent!, axis: Int): Float
Get axis value for the first pointer index (may be an arbitrary pointer identifier).
| Parameters | |
|---|---|
event: MotionEvent! |
motion event for which to get the value. |
axis: Int |
The axis identifier for the axis value to retrieve. |
@ReplaceWith(expression = "event.getAxisValue(axis, pointerIndex)")
java-static fungetAxisValue(event: MotionEvent!, axis: Int, pointerIndex: Int): Float
Returns the value of the requested axis for the given pointer index (use getPointerId to find the pointer identifier for this index).
| Parameters | |
|---|---|
event: MotionEvent! |
motion event for which to get the value. |
axis: Int |
The axis identifier for the axis value to retrieve. |
pointerIndex: Int |
Raw index of pointer to retrieve. Value may be from 0 (the first pointer that is down) to |
| Returns | |
|---|---|
Float |
The value of the axis, or 0 if the axis is not available. |
@ReplaceWith(expression = "event.getButtonState()")
java-static fungetButtonState(event: MotionEvent!): Int
@ReplaceWith(expression = "event.getPointerCount()")
java-static fungetPointerCount(event: MotionEvent!): Int
The number of pointers of data contained in this event. Always
@ReplaceWith(expression = "event.getPointerId(pointerIndex)")
java-static fungetPointerId(event: MotionEvent!, pointerIndex: Int): Int
Call getPointerId.
@ReplaceWith(expression = "event.getSource()")
java-static fungetSource(event: MotionEvent!): Int
Gets the source of the event.
| Returns | |
|---|---|
Int |
The event source or |
@ReplaceWith(expression = "event.getX(pointerIndex)")
java-static fungetX(event: MotionEvent!, pointerIndex: Int): Float
Call getX.
@ReplaceWith(expression = "event.getY(pointerIndex)")
java-static fungetY(event: MotionEvent!, pointerIndex: Int): Float
Call getY.
isFromSource
java-static fun isFromSource(event: MotionEvent, source: Int): Boolean
Determines whether the event is from the given source.
| Parameters | |
|---|---|
event: MotionEvent |
motion event for which to check the source. |
source: Int |
The input source to check against. |
| Returns | |
|---|---|
Boolean |
Whether the event is from the given source. |