{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
public final class MotionEvents
Facilitates sending of motion events to a UiController.
Nested types |
|
|---|---|
MotionEvents.DownResultHolder |
Holds the result of a down motion. |
Public constructors |
|
|---|---|
Public methods |
|
|---|---|
static MotionEvent |
obtainDownEvent(Obtains the |
static MotionEvent |
obtainDownEvent(float[] coordinates, float[] precision) |
static @NonNull MotionEvent |
obtainMovement(Create a new move motion event associated with the specified down motion event, at the current time. |
static @NonNull MotionEvent |
obtainMovement(Create a new move motion event associated with the specified down motion event. |
static MotionEvent |
This method is deprecated. Use |
static MotionEvent |
This method is deprecated. Use |
static MotionEvent |
obtainUpEvent(MotionEvent downEvent, float[] coordinates)Create a new finger up motion event associated with the specified down motion event, at the current time. |
static MotionEvent |
obtainUpEvent(Create a new finger up motion event associated with the specified down motion event. |
static void |
sendCancel(UiController uiController, MotionEvent downEvent) |
static MotionEvents.DownResultHolder |
sendDown( |
static MotionEvents.DownResultHolder |
sendDown( |
static boolean |
sendMovement( |
static boolean |
sendUp(UiController uiController, MotionEvent downEvent) |
static boolean |
sendUp( |
public static MotionEvent obtainDownEvent(
float[] coordinates,
float[] precision,
int inputDevice,
int buttonState
)
Obtains the MotionEvent of down.
public static @NonNull MotionEvent obtainMovement(
@NonNull MotionEvent downEvent,
@NonNull float[] coordinates
)
Create a new move motion event associated with the specified down motion event, at the current time.
| Parameters | |
|---|---|
@NonNull MotionEvent downEvent |
the finger down motion event assoicated with this event. |
@NonNull float[] coordinates |
The coordinates of the event |
public static @NonNull MotionEvent obtainMovement(
@NonNull MotionEvent downEvent,
long eventTime,
@NonNull float[] coordinates
)
Create a new move motion event associated with the specified down motion event.
| Parameters | |
|---|---|
@NonNull MotionEvent downEvent |
the finger down motion event assoicated with this event. |
long eventTime |
The the time (in ms) when this specific event was generated. |
@NonNull float[] coordinates |
The coordinates of the event |
public static MotionEventobtainMovement(long downTime, long eventTime, float[] coordinates)
public static MotionEvent obtainUpEvent(MotionEvent downEvent, float[] coordinates)
Create a new finger up motion event associated with the specified down motion event, at the current time.
| Parameters | |
|---|---|
MotionEvent downEvent |
the finger down motion event assoicated with this event. |
float[] coordinates |
The coordinates of the event |
public static MotionEvent obtainUpEvent(
MotionEvent downEvent,
long eventTime,
float[] coordinates
)
Create a new finger up motion event associated with the specified down motion event.
| Parameters | |
|---|---|
MotionEvent downEvent |
the finger down motion event assoicated with this event. |
long eventTime |
The the time (in ms) when this specific event was generated. |
float[] coordinates |
The coordinates of the event |
public static MotionEvents.DownResultHolder sendDown(
UiController uiController,
float[] coordinates,
float[] precision
)
public static MotionEvents.DownResultHolder sendDown(
UiController uiController,
float[] coordinates,
float[] precision,
int inputDevice,
int buttonState
)
public static boolean sendMovement(
UiController uiController,
MotionEvent downEvent,
float[] coordinates
)
public static boolean sendUp(
UiController uiController,
MotionEvent downEvent,
float[] coordinates
)