{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

Tapper

interface Tapper

Known direct subclasses
Tap

Executes different click types to given position.


Interface to implement different click types.

Summary

Nested types

Tapper.Status

The result of the tap.

Public functions

Any!
sendTap(
    uiController: UiController!,
    coordinates: FloatArray!,
    precision: FloatArray!,
    inputDevice: Int,
    buttonState: Int
)

Sends a MotionEvent to the given UiController.

Any!
sendTap(
    uiController: UiController!,
    coordinates: FloatArray!,
    precision: FloatArray!
)

This function is deprecated.

Use @{link #sendTap(UiController, float[], float[], int, int)} instead This will call the @{link #sendTap(UiController, float[], float[], int, int)} with SOURCE_UNKNOWN, BUTTON_PRIMARY by default.

Public functions

sendTap

fun sendTap(
    uiController: UiController!,
    coordinates: FloatArray!,
    precision: FloatArray!,
    inputDevice: Int,
    buttonState: Int
): Any!

Sends a MotionEvent to the given UiController.

Parameters
uiController: UiController!

a UiController to use to send MotionEvents to the screen.

coordinates: FloatArray!

a float[] with x and y values of center of the tap.

precision: FloatArray!

a float[] with x and y values of precision of the tap.

inputDevice: Int

the input device of the tap, ie. InputDevice.SOURCE_MOUSE.

buttonState: Int

the button the tap is received from, ie. BUTTON_PRIMARY, BUTTON_SECONDARY.

Returns
Any!

The status of the tap.

sendTap

fun sendTap(
    uiController: UiController!,
    coordinates: FloatArray!,
    precision: FloatArray!
): Any!