Class Overview
Helper for accessing features in MotionEvent
introduced
after API level 4 in a backwards compatible fashion.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Constants
public
static
final
int
ACTION_HOVER_ENTER
Constant Value:
9
(0x00000009)
public
static
final
int
ACTION_HOVER_EXIT
Constant Value:
10
(0x0000000a)
public
static
final
int
ACTION_HOVER_MOVE
Constant Value:
7
(0x00000007)
public
static
final
int
ACTION_MASK
Constant Value:
255
(0x000000ff)
public
static
final
int
ACTION_POINTER_DOWN
Constant Value:
5
(0x00000005)
public
static
final
int
ACTION_POINTER_INDEX_MASK
Constant Value:
65280
(0x0000ff00)
public
static
final
int
ACTION_POINTER_INDEX_SHIFT
Constant Value:
8
(0x00000008)
public
static
final
int
ACTION_POINTER_UP
Constant Value:
6
(0x00000006)
public
static
final
int
ACTION_SCROLL
Constant Value:
8
(0x00000008)
public
static
final
int
AXIS_BRAKE
Constant Value:
23
(0x00000017)
public
static
final
int
AXIS_DISTANCE
Constant Value:
24
(0x00000018)
public
static
final
int
AXIS_GAS
Constant Value:
22
(0x00000016)
public
static
final
int
AXIS_GENERIC_1
Constant Value:
32
(0x00000020)
public
static
final
int
AXIS_GENERIC_10
Constant Value:
41
(0x00000029)
public
static
final
int
AXIS_GENERIC_11
Constant Value:
42
(0x0000002a)
public
static
final
int
AXIS_GENERIC_12
Constant Value:
43
(0x0000002b)
public
static
final
int
AXIS_GENERIC_13
Constant Value:
44
(0x0000002c)
public
static
final
int
AXIS_GENERIC_14
Constant Value:
45
(0x0000002d)
public
static
final
int
AXIS_GENERIC_15
Constant Value:
46
(0x0000002e)
public
static
final
int
AXIS_GENERIC_16
Constant Value:
47
(0x0000002f)
public
static
final
int
AXIS_GENERIC_2
Constant Value:
33
(0x00000021)
public
static
final
int
AXIS_GENERIC_3
Constant Value:
34
(0x00000022)
public
static
final
int
AXIS_GENERIC_4
Constant Value:
35
(0x00000023)
public
static
final
int
AXIS_GENERIC_5
Constant Value:
36
(0x00000024)
public
static
final
int
AXIS_GENERIC_6
Constant Value:
37
(0x00000025)
public
static
final
int
AXIS_GENERIC_7
Constant Value:
38
(0x00000026)
public
static
final
int
AXIS_GENERIC_8
Constant Value:
39
(0x00000027)
public
static
final
int
AXIS_GENERIC_9
Constant Value:
40
(0x00000028)
public
static
final
int
AXIS_HAT_X
Constant Value:
15
(0x0000000f)
public
static
final
int
AXIS_HAT_Y
Constant Value:
16
(0x00000010)
public
static
final
int
AXIS_HSCROLL
Constant Value:
10
(0x0000000a)
public
static
final
int
AXIS_LTRIGGER
Constant Value:
17
(0x00000011)
public
static
final
int
AXIS_ORIENTATION
Constant Value:
8
(0x00000008)
public
static
final
int
AXIS_PRESSURE
Constant Value:
2
(0x00000002)
public
static
final
int
AXIS_RTRIGGER
Constant Value:
18
(0x00000012)
public
static
final
int
AXIS_RUDDER
Constant Value:
20
(0x00000014)
public
static
final
int
AXIS_RX
Constant Value:
12
(0x0000000c)
public
static
final
int
AXIS_RY
Constant Value:
13
(0x0000000d)
public
static
final
int
AXIS_RZ
Constant Value:
14
(0x0000000e)
public
static
final
int
AXIS_SIZE
Constant Value:
3
(0x00000003)
public
static
final
int
AXIS_THROTTLE
Constant Value:
19
(0x00000013)
public
static
final
int
AXIS_TILT
Constant Value:
25
(0x00000019)
public
static
final
int
AXIS_TOOL_MAJOR
Constant Value:
6
(0x00000006)
public
static
final
int
AXIS_TOOL_MINOR
Constant Value:
7
(0x00000007)
public
static
final
int
AXIS_TOUCH_MAJOR
Constant Value:
4
(0x00000004)
public
static
final
int
AXIS_TOUCH_MINOR
Constant Value:
5
(0x00000005)
public
static
final
int
AXIS_VSCROLL
Constant Value:
9
(0x00000009)
public
static
final
int
AXIS_WHEEL
Constant Value:
21
(0x00000015)
public
static
final
int
AXIS_X
Constant Value:
0
(0x00000000)
public
static
final
int
AXIS_Y
Constant Value:
1
(0x00000001)
public
static
final
int
AXIS_Z
Constant Value:
11
(0x0000000b)
Public Constructors
public
MotionEventCompat
()
Public Methods
public
static
int
findPointerIndex
(MotionEvent event, int pointerId)
public
static
int
getActionIndex
(MotionEvent event)
Call getAction()
, returning only the pointer index
portion
public
static
float
getAxisValue
(MotionEvent event, int axis, int pointerIndex)
Returns the value of the requested axis for the given pointer index
(use getPointerId(MotionEvent, int)
to find the pointer identifier for this index).
Parameters
axis
| The axis identifier for the axis value to retrieve. |
pointerIndex
| Raw index of pointer to retrieve. Value may be from 0
(the first pointer that is down) to getPointerCount(MotionEvent) -1. |
Returns
- The value of the axis, or 0 if the axis is not available.
public
static
float
getAxisValue
(MotionEvent event, int axis)
Get axis value for the first pointer index (may be an
arbitrary pointer identifier).
Parameters
axis
| The axis identifier for the axis value to retrieve. |
public
static
int
getPointerCount
(MotionEvent event)
The number of pointers of data contained in this event. Always
>= 1.
public
static
int
getPointerId
(MotionEvent event, int pointerIndex)
public
static
int
getSource
(MotionEvent event)
Gets the source of the event.
public
static
float
getX
(MotionEvent event, int pointerIndex)
public
static
float
getY
(MotionEvent event, int pointerIndex)