🌈 Create new beautiful Compose Gradients with our new wesite ->
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
public 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

Source set: Common
@Deprecated(
        message = "This property is deprecated. Use 'pointerInputEventHandler' instead.",
        level = DeprecationLevel.ERROR,
        replaceWith =
            ReplaceWith(
                "pointerInputEventHandler",
                "androidx.compose.ui.input.pointer." +
                    "SuspendingPointerInputModifierNode.pointerInputEventHandler",
            ),
    )
    public var pointerInputHandler: suspend PointerInputScope.() -> Unit

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

pointerInputEventHandler

Source set: Common
public var pointerInputEventHandler: PointerInputEventHandler

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

Functions

resetPointerInputHandler

Source set: Common
public 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.