Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

androidx.compose.ui.input.pointer

Interfaces

HandlePointerInputScope

Receiver scope for awaiting pointer events in a call to PointerInputScope.handlePointerInput.

PointerInputScope

Receiver scope for Modifier.pointerInput that permits handling pointer input and sending custom input events.

Classes

PointerEvent

Describes a pointer input change event that has occurred at a particular point in time.

PointerInputEvent

The normalized data structure for pointer input event information that is taken in processed by Compose (via the PointerInputEventProcessor).

PointerInputEventData

Data that describes a particular pointer

RequestDisallowInterceptTouchEvent

Function that can be passed to pointerInteropFilter and then later invoked which provides an analog to ViewParent.requestDisallowInterceptTouchEvent.

Annotations

MouseTemporaryApi

Top-level properties summary

actual Boolean

Extension functions summary

For Modifier
Modifier
Modifier.pointerInput(block: suspend PointerInputScope.() -> Unit)

Create a modifier for processing pointer input within the region of the modified element.

Modifier
Modifier.pointerInteropFilter(requestDisallowInterceptTouchEvent: RequestDisallowInterceptTouchEvent? = null, onTouchEvent: (MotionEvent) -> Boolean)

A special PointerInputModifier that provides access to the underlying MotionEvents originally dispatched to Compose.

Top-level properties

isMouseInput

actual val isMouseInput: Boolean

Extension functions

pointerInput

fun Modifier.pointerInput(block: suspend PointerInputScope.() -> Unit): Modifier

Create a modifier for processing pointer input within the region of the modified element.

pointerInputs may call PointerInputScope.handlePointerInput to install a pointer input handler that can HandlePointerInputScope.awaitPointerEvent to receive and consume pointer input events. Extension functions on PointerInputScope or HandlePointerInputScope may be defined to perform higher-level gesture detection.

pointerInteropFilter

fun Modifier.pointerInteropFilter(
    requestDisallowInterceptTouchEvent: RequestDisallowInterceptTouchEvent? = null,
    onTouchEvent: (MotionEvent) -> Boolean
): Modifier

A special PointerInputModifier that provides access to the underlying MotionEvents originally dispatched to Compose.

While the main intent of this Modifier is to allow arbitrary code to access the original MotionEvent dispatched to Compose, for completeness, analogs are provided to allow arbitrary code to interact with the system as if it were an Android View.

This includes 2 APIs,

  1. onTouchEvent has a Boolean return type which is akin to the return type of View.onTouchEvent. If the provided onTouchEvent returns true, it will continue to receive the event stream (unless the event stream has been intercepted) and if it returns false, it will not.
  2. requestDisallowInterceptTouchEvent is a lambda that you can optionally provide so that you can later call it (yes, in this case, you call the lambda that you provided) which is akin to calling ViewParent.requestDisallowInterceptTouchEvent. When this is called, any associated ancestors in the tree that abide by the contract will act accordingly and will not intercept the even stream.