MotionEventCompat

Added in 1.1.0

public final class MotionEventCompat


Helper for accessing features in MotionEvent.

Summary

Constants

static final int

This field is deprecated.

Use ACTION_HOVER_ENTER directly.

static final int

This field is deprecated.

Use ACTION_HOVER_EXIT directly.

static final int

This field is deprecated.

Use ACTION_HOVER_MOVE directly.

static final int

This field is deprecated.

Use ACTION_MASK directly.

static final int

This field is deprecated.

Use ACTION_POINTER_DOWN directly.

static final int

This field is deprecated.

Use ACTION_POINTER_INDEX_MASK directly.

static final int

This field is deprecated.

Use ACTION_POINTER_INDEX_SHIFT directly.

static final int

This field is deprecated.

Use ACTION_POINTER_UP directly.

static final int

This field is deprecated.

Use ACTION_SCROLL directly.

static final int

This field is deprecated.

Use AXIS_BRAKE directly.

static final int

This field is deprecated.

Use AXIS_DISTANCE directly.

static final int

This field is deprecated.

Use AXIS_GAS directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_1 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_10 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_11 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_12 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_13 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_14 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_15 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_16 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_2 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_3 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_4 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_5 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_6 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_7 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_8 directly.

static final int

This field is deprecated.

Use AXIS_GENERIC_9 directly.

static final int

This field is deprecated.

Use AXIS_HAT_X directly.

static final int

This field is deprecated.

Use AXIS_HAT_Y directly.

static final int

This field is deprecated.

Use AXIS_HSCROLL directly.

static final int

This field is deprecated.

Use AXIS_LTRIGGER directly.

static final int

This field is deprecated.

Use AXIS_ORIENTATION directly.

static final int

This field is deprecated.

Use AXIS_PRESSURE directly.

static final int

Synonym for AXIS_RELATIVE_X.

static final int

Synonym for AXIS_RELATIVE_Y.

static final int

This field is deprecated.

Use AXIS_RTRIGGER directly.

static final int

This field is deprecated.

Use AXIS_RUDDER directly.

static final int
AXIS_RX = 12

This field is deprecated.

Use AXIS_RX directly.

static final int
AXIS_RY = 13

This field is deprecated.

Use AXIS_RY directly.

static final int
AXIS_RZ = 14

This field is deprecated.

Use AXIS_RZ directly.

static final int

Synonym for AXIS_SCROLL.

static final int

This field is deprecated.

Use AXIS_SIZE directly.

static final int

This field is deprecated.

Use AXIS_THROTTLE directly.

static final int

This field is deprecated.

Use AXIS_TILT directly.

static final int

This field is deprecated.

Use AXIS_TOOL_MAJOR directly.

static final int

This field is deprecated.

Use AXIS_TOOL_MINOR directly.

static final int

This field is deprecated.

Use AXIS_TOUCH_MAJOR directly.

static final int

This field is deprecated.

Use AXIS_TOUCH_MINOR directly.

static final int

This field is deprecated.

Use AXIS_VSCROLL directly.

static final int

This field is deprecated.

Use AXIS_WHEEL directly.

static final int
AXIS_X = 0

This field is deprecated.

Use AXIS_X directly.

static final int
AXIS_Y = 1

This field is deprecated.

Use AXIS_Y directly.

static final int
AXIS_Z = 11

This field is deprecated.

Use AXIS_Z directly.

static final int

This field is deprecated.

Use BUTTON_PRIMARY directly.

Public methods

static int
@ReplaceWith(expression = "event.findPointerIndex(pointerId)")
findPointerIndex(MotionEvent event, int pointerId)

This method is deprecated.

Call findPointerIndex directly.

static int
@ReplaceWith(expression = "event.getActionIndex()")
getActionIndex(MotionEvent event)

This method is deprecated.

Call getActionIndex directly.

static int
@ReplaceWith(expression = "event.getActionMasked()")
getActionMasked(MotionEvent event)

This method is deprecated.

Call getAction directly.

static float
@ReplaceWith(expression = "event.getAxisValue(axis)")
getAxisValue(MotionEvent event, int axis)

This method is deprecated.

Call getAxisValue directly.

static float
@ReplaceWith(expression = "event.getAxisValue(axis, pointerIndex)")
getAxisValue(MotionEvent event, int axis, int pointerIndex)

This method is deprecated.

Call getAxisValue directly.

static int
@ReplaceWith(expression = "event.getButtonState()")
getButtonState(MotionEvent event)

This method is deprecated.

Call getButtonState directly.

static int
@ReplaceWith(expression = "event.getPointerCount()")
getPointerCount(MotionEvent event)

This method is deprecated.

Call getPointerCount directly.

static int
@ReplaceWith(expression = "event.getPointerId(pointerIndex)")
getPointerId(MotionEvent event, int pointerIndex)

This method is deprecated.

Call getPointerId directly.

static int
@ReplaceWith(expression = "event.getSource()")
getSource(MotionEvent event)

This method is deprecated.

Call getSource directly.

static float
@ReplaceWith(expression = "event.getX(pointerIndex)")
getX(MotionEvent event, int pointerIndex)

This method is deprecated.

Call getX directly.

static float
@ReplaceWith(expression = "event.getY(pointerIndex)")
getY(MotionEvent event, int pointerIndex)

This method is deprecated.

Call getY directly.

static boolean
isFromSource(@NonNull MotionEvent event, int source)

Determines whether the event is from the given source.

Constants

ACTION_HOVER_ENTER

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_HOVER_ENTER = 9

Synonym for ACTION_HOVER_ENTER.

ACTION_HOVER_EXIT

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_HOVER_EXIT = 10

Synonym for ACTION_HOVER_EXIT.

ACTION_HOVER_MOVE

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_HOVER_MOVE = 7

Synonym for ACTION_HOVER_MOVE.

ACTION_MASK

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_MASK = 255

Synonym for ACTION_MASK.

ACTION_POINTER_DOWN

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_POINTER_DOWN = 5

Synonym for ACTION_POINTER_DOWN.

ACTION_POINTER_INDEX_MASK

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_POINTER_INDEX_MASK = 65280

Synonym for ACTION_POINTER_INDEX_MASK.

ACTION_POINTER_INDEX_SHIFT

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_POINTER_INDEX_SHIFT = 8

Synonym for ACTION_POINTER_INDEX_SHIFT.

ACTION_POINTER_UP

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_POINTER_UP = 6

Synonym for ACTION_POINTER_UP.

ACTION_SCROLL

Added in 1.1.0
Deprecated in 1.1.0
public static final int ACTION_SCROLL = 8

Synonym for ACTION_SCROLL.

AXIS_BRAKE

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_BRAKE = 23

Synonym for AXIS_BRAKE.

AXIS_DISTANCE

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_DISTANCE = 24

Synonym for AXIS_DISTANCE.

AXIS_GAS

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GAS = 22

Synonym for AXIS_GAS.

AXIS_GENERIC_1

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_1 = 32

Synonym for AXIS_GENERIC_1.

AXIS_GENERIC_10

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_10 = 41

Synonym for AXIS_GENERIC_10.

AXIS_GENERIC_11

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_11 = 42

Synonym for AXIS_GENERIC_11.

AXIS_GENERIC_12

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_12 = 43

Synonym for AXIS_GENERIC_12.

AXIS_GENERIC_13

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_13 = 44

Synonym for AXIS_GENERIC_13.

AXIS_GENERIC_14

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_14 = 45

Synonym for AXIS_GENERIC_14.

AXIS_GENERIC_15