Interface

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).

Source set: Common
sealed interface SuspendingPointerInputModifierNode : PointerInputModifierNode

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.

Properties

pointerInputHandler

Deprecated

This property is deprecated. Use 'pointerInputEventHandler' instead.

Source set: Common
var pointerInputHandler: suspend PointerInputScope.() -> Unit

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

pointerInputEventHandler

Source set: Common
var pointerInputEventHandler: PointerInputEventHandler

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

Functions

resetPointerInputHandler

fun resetPointerInputHandler()

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 pointerInputEventHandler 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.

Last updated: