SuspendingPointerInputModifierNode



Extends PointerInputModifierNode with a handler to execute asynchronously when an event occurs and a function to reset that handler (cancels the existing coroutine and essentially resets the handler's execution). Note: The handler still executes lazily, meaning nothing will be done until a new event comes in.

Summary

Public functions

Unit

Resets the underlying coroutine used to run the handler for input pointer events.

Cmn

Public properties

suspend PointerInputScope.() -> Unit

Handler for pointer input events.

Cmn

Inherited functions

From androidx.compose.ui.node.PointerInputModifierNode
open Boolean

Intercept pointer input that children receive even if the pointer is out of bounds.

Cmn
Unit

Invoked to notify the handler that no more calls to PointerInputModifierNode will be made, until at least new pointers exist.

Cmn
open Unit

Invoked when the density (pixels per inch for the screen) changes.

Cmn
Unit
onPointerEvent(
    pointerEvent: PointerEvent,
    pass: PointerEventPass,
    bounds: IntSize
)

Invoked when pointers that previously hit this PointerInputModifierNode have changed.

Cmn
open Unit

Invoked when the view configuration (touch slop size, minimum touch target, tap timing) changes which means the composable UI the pointer input block is tied to has changed and the new UI might impact the location of pointer input events (x and y).

Cmn
open Boolean

If false, then this PointerInputModifierNode will not allow siblings under it to respond to events.

Cmn

Inherited properties

From androidx.compose.ui.node.DelegatableNode
Modifier.Node

A reference of the Modifier.Node that holds this node's position in the node hierarchy.

Cmn

Public functions

resetPointerInputHandler

fun resetPointerInputHandler(): Unit

Resets the underlying coroutine used to run the handler for input pointer events. This should be called whenever a large change has been made that forces the gesture detection to be completely invalid.

For example, if pointerInputHandler has different modes for detecting a gesture (long press, double click, etc.), and by switching the modes, any currently-running gestures are no longer valid.

Public properties

pointerInputHandler

var pointerInputHandler: suspend PointerInputScope.() -> Unit

Handler for pointer input events. When changed, any previously executing pointerInputHandler will be canceled.