SuspendingPointerInputModifierNode
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
Deprecated This property is deprecated. Use 'pointerInputEventHandler' instead.
var pointerInputHandler: suspend PointerInputScope.() -> Unit
Handler for pointer input events. When changed, any previously executing pointerInputHandler will be canceled.
var pointerInputEventHandler: PointerInputEventHandler
Handler for pointer input events. When changed, any previously executing pointerInputEventHandler will be canceled.
Functions
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.