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

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_15 = 46

Synonym for AXIS_GENERIC_15.

AXIS_GENERIC_16

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_16 = 47

Synonym for AXIS_GENERIC_16.

AXIS_GENERIC_2

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_2 = 33

Synonym for AXIS_GENERIC_2.

AXIS_GENERIC_3

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_3 = 34

Synonym for AXIS_GENERIC_3.

AXIS_GENERIC_4

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_4 = 35

Synonym for AXIS_GENERIC_4.

AXIS_GENERIC_5

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_5 = 36

Synonym for AXIS_GENERIC_5.

AXIS_GENERIC_6

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_6 = 37

Synonym for AXIS_GENERIC_6.

AXIS_GENERIC_7

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_7 = 38

Synonym for AXIS_GENERIC_7.

AXIS_GENERIC_8

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_8 = 39

Synonym for AXIS_GENERIC_8.

AXIS_GENERIC_9

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_GENERIC_9 = 40

Synonym for AXIS_GENERIC_9.

AXIS_HAT_X

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_HAT_X = 15

Synonym for AXIS_HAT_X.

AXIS_HAT_Y

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_HAT_Y = 16

Synonym for AXIS_HAT_Y.

AXIS_HSCROLL

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

Synonym for AXIS_HSCROLL.

AXIS_LTRIGGER

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_LTRIGGER = 17

Synonym for AXIS_LTRIGGER.

AXIS_ORIENTATION

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

Synonym for AXIS_ORIENTATION.

AXIS_PRESSURE

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_PRESSURE = 2

Synonym for AXIS_PRESSURE.

AXIS_RELATIVE_X

Added in 1.1.0
public static final int AXIS_RELATIVE_X = 27

Synonym for AXIS_RELATIVE_X.

AXIS_RELATIVE_Y

Added in 1.1.0
public static final int AXIS_RELATIVE_Y = 28

Synonym for AXIS_RELATIVE_Y.

AXIS_RTRIGGER

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_RTRIGGER = 18

Synonym for AXIS_RTRIGGER.

AXIS_RUDDER

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_RUDDER = 20

Synonym for AXIS_RUDDER.

AXIS_RX

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_RX = 12

Synonym for AXIS_RX.

AXIS_RY

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_RY = 13

Synonym for AXIS_RY.

AXIS_RZ

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_RZ = 14

Synonym for AXIS_RZ.

AXIS_SCROLL

Added in 1.1.0
public static final int AXIS_SCROLL = 26

Synonym for AXIS_SCROLL.

AXIS_SIZE

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_SIZE = 3

Synonym for AXIS_SIZE.

AXIS_THROTTLE

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_THROTTLE = 19

Synonym for AXIS_THROTTLE.

AXIS_TILT

Added in 1.1.0
Deprecated in 1.1.0
public static final int AXIS_TILT = 25

Synonym for AXIS_TILT.

AXIS_TOOL_MAJOR

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

Synonym for AXIS_TOOL_MAJOR.

AXIS_TOOL_MINOR