MotionEvents

public final class MotionEvents


Facilitates sending of motion events to a UiController.

Summary

Nested types

public class MotionEvents.DownResultHolder

Holds the result of a down motion.

Public constructors

Public methods

static MotionEvent
obtainDownEvent(
    float[] coordinates,
    float[] precision,
    int inputDevice,
    int buttonState
)

Obtains the MotionEvent of down.

static MotionEvent
obtainDownEvent(float[] coordinates, float[] precision)
static MotionEvent
obtainMovement(MotionEvent downEvent, float[] coordinates)

Create a new move motion event associated with the specified down motion event, at the current time.

static MotionEvent
obtainMovement(
    MotionEvent downEvent,
    long eventTime,
    float[] coordinates
)

Create a new move motion event associated with the specified down motion event.

static MotionEvent
obtainMovement(long downTime, float[] coordinates)

This method is deprecated.

Use obtainMovement instead.

static MotionEvent
obtainMovement(long downTime, long eventTime, float[] coordinates)

This method is deprecated.

Use obtainMovement instead.

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(
    MotionEvent downEvent,
    long eventTime,
    float[] coordinates
)

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(
    UiController uiController,
    float[] coordinates,
    float[] precision,
    int inputDevice,
    int buttonState
)
static MotionEvents.DownResultHolder
sendDown(
    UiController uiController,
    float[] coordinates,
    float[] precision
)
static boolean
sendMovement(
    UiController uiController,
    MotionEvent downEvent,
    float[] coordinates
)
static boolean
sendUp(
    UiController uiController,
    MotionEvent downEvent,
    float[] coordinates
)
static boolean
sendUp(UiController uiController, MotionEvent downEvent)

Public constructors

MotionEvents

public MotionEvents()

Public methods

obtainDownEvent

public static MotionEvent obtainDownEvent(
    float[] coordinates,
    float[] precision,
    int inputDevice,
    int buttonState
)

Obtains the MotionEvent of down.

obtainDownEvent

public static MotionEvent obtainDownEvent(float[] coordinates, float[] precision)

obtainMovement

public static MotionEvent obtainMovement(MotionEvent downEvent, float[] coordinates)

Create a new move 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

obtainMovement

public static MotionEvent obtainMovement(
    MotionEvent downEvent,
    long eventTime,
    float[] coordinates
)

Create a new move 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

obtainMovement

public static MotionEvent obtainMovement(long downTime, float[] coordinates)

obtainMovement

public static MotionEvent obtainMovement(long downTime, long eventTime, float[] coordinates)

obtainUpEvent

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

obtainUpEvent

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

sendCancel

public static void sendCancel(UiController uiController, MotionEvent downEvent)

sendDown

public static MotionEvents.DownResultHolder sendDown(
    UiController uiController,
    float[] coordinates,
    float[] precision,
    int inputDevice,
    int buttonState
)

sendDown

public static MotionEvents.DownResultHolder sendDown(
    UiController uiController,
    float[] coordinates,
    float[] precision
)

sendMovement

public static boolean sendMovement(
    UiController uiController,
    MotionEvent downEvent,
    float[] coordinates
)

sendUp

public static boolean sendUp(
    UiController uiController,
    MotionEvent downEvent,
    float[] coordinates
)

sendUp

public static boolean sendUp(UiController uiController, MotionEvent downEvent)