MotionEvent
declare class MotionEvent {}
Object used to report movement (mouse, finger) events. Motion events may hold either absolute or relative movements and other data,
Static Property
ACTION_DOWN
Signature
declare class MotionEvent {
static ACTION_DOWN: number
}
Description
A pressed gesture has started, the motion contains the initial starting location.
ACTION_UP
Signature
declare class MotionEvent {
static ACTION_UP: number
}
Description
A pressed gesture has finished, the motion contains the final release location as well as any intermediate points since the last down or move event.
ACTION_MOVE
Signature
declare class MotionEvent {
static ACTION_MOVE: number
}
Description
A change has happened during a press gesture (betweenACTION_DOWN
andACTION_UP
).
ACTION_CANCEL
Signature
declare class MotionEvent {
static ACTION_CANCEL: number
}
Description
The current gesture has been aborted.
ACTION_SCROLL
Signature
declare class MotionEvent {
static ACTION_SCROLL: number
}
Description
The motion event contains relative vertical and/or horizontal scroll offsets.
AXIS_VSCROLL
Signature
declare class MotionEvent {
static AXIS_VSCROLL: number
}
Description
Axis constant: Vertical Scroll axis of a motion event.
AXIS_HSCROLL
Signature
declare class MotionEvent {
static AXIS_HSCROLL: number
}
Description
Axis constant: Horizontal Scroll axis of a motion event.
ACTION_HOVER_ENTER
Signature
declare class MotionEvent {
static ACTION_HOVER_ENTER: number
}
Description
The pointer is not down but has entered the boundaries of a window or view.
ACTION_HOVER_MOVE
Signature
declare class MotionEvent {
static ACTION_HOVER_MOVE: number
}
Description
A change happened but the pointer is not down (unlikeACTION_MOVE
).
ACTION_HOVER_EXIT
Signature
declare class MotionEvent {
static ACTION_HOVER_EXIT: number
}
Description
The pointer is not down but has exited the boundaries of a window or view.
Instance Method
getDownTime
Signature
declare class MotionEvent {
getDownTime(): number
}
Description
Returns the time (in ms) when the user originally pressed down to start a stream of position events.
getEventTimeNano
Signature
declare class MotionEvent {
getEventTimeNano(): number
}
Description
Retrieve the time this event occurred.
getAxisValue
Signature
declare class MotionEvent {
getAxisValue(axis: number): number
}
Description
Returns the value of the requested axis for the given pointer index (usegetPointerId(int)
to find the pointer identifier for this index).
getPointerId
Signature
declare class MotionEvent {
getPointerId(pointerIndex: number): number
}
Description
Return the pointer identifier associated with a particular pointer data index in this event.
getPointerCount
Signature
declare class MotionEvent {
getPointerCount(): number
}
Description
Thenumber
of pointers of data contained in this event.
getX
Signature
declare class MotionEvent {
getX(): number
}
Description
Equivalent togetX(int)
for pointer index 0 (regardless of the pointer identifier).
getX
Signature
declare class MotionEvent {
getX(index: number): number
}
Description
Returns the X coordinate of the pointer referenced by pointerIndex for this motion event.
getY
Signature
declare class MotionEvent {
getY(): number
}
Description
Equivalent togetY(int)
for pointer index 0 (regardless of the pointer identifier).
getY
Signature
declare class MotionEvent {
getY(index: number): number
}
Description
Returns the Y coordinate of the pointer referenced by pointerIndex for this motion event.
getRawX
Signature
declare class MotionEvent {
getRawX(): number
}
Description
Equivalent togetRawX(int)
for pointer index 0 (regardless of the pointer identifier).
getRawX
Signature
declare class MotionEvent {
getRawX(index: number): number
}
Description
Returns the X coordinate of the pointer referenced by pointerIndex for this motion event.
getRawY
Signature
declare class MotionEvent {
getRawY(): number
}
Description
Equivalent togetRawY(int)
for pointer index 0 (regardless of the pointer identifier).
getRawY
Signature
declare class MotionEvent {
getRawY(index: number): number
}
Description
Returns the Y coordinate of the pointer referenced by pointerIndex for this motion event.
getAction
Signature
declare class MotionEvent {
getAction(): number
}
Description
Return the kind of action being performed.
findPointerIndex
Signature
declare class MotionEvent {
findPointerIndex(pointerId: number): number
}
Description
Given a pointer identifier, find the index of its data in the event.
getActionMasked
Signature
declare class MotionEvent {
getActionMasked(): number
}
Description
Return the masked action being performed, without pointer index information.
getPointerCoords
Signature
declare class MotionEvent {
getPointerCoords(pointerIndex: number, outPointerCoords: MotionEvent.PointerCoords): void
}
Description
Populates aPointerCoords
object with pointer coordinate data for the specified pointer index.
MotionEvent.PointerCoords
Transfer object for pointer coordinates. Objects of this type can be used to specify the pointer coordinates when creating new MotionEvent objects and to query pointer coordinates in bulk.
declare class PointerCoords {}
Instance Property
x
Type
declare interface PointerCoords {
x: number;
}
Description
The X component of the pointer movement.
y
Type
declare interface PointerCoords {
y: number;
}
Description
The Y component of the pointer movement.