CombinedClickableNode



Public interface for the internal node used inside combinedClickable, to allow for custom modifier nodes to delegate to it.

Note: This API is experimental and is temporarily being exposed to enable performance analysis, you should use combinedClickable instead for the majority of use cases.

Summary

Public functions

Unit
update(
    onClick: () -> Unit,
    onLongClickLabel: String?,
    onLongClick: (() -> Unit)?,
    onDoubleClick: (() -> Unit)?,
    interactionSource: MutableInteractionSource?,
    indicationNodeFactory: IndicationNodeFactory?,
    enabled: Boolean,
    onClickLabel: String?,
    role: Role?
)

Updates this node with new values, and resets any invalidated state accordingly.

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

update

fun update(
    onClick: () -> Unit,
    onLongClickLabel: String?,
    onLongClick: (() -> Unit)?,
    onDoubleClick: (() -> Unit)?,
    interactionSource: MutableInteractionSource?,
    indicationNodeFactory: IndicationNodeFactory?,
    enabled: Boolean,
    onClickLabel: String?,
    role: Role?
): Unit

Updates this node with new values, and resets any invalidated state accordingly.

Parameters
onClick: () -> Unit

will be called when user clicks on the element

onLongClickLabel: String?

semantic / accessibility label for the onLongClick action

onLongClick: (() -> Unit)?

will be called when user long presses on the element

onDoubleClick: (() -> Unit)?

will be called when user double clicks on the element

interactionSource: MutableInteractionSource?

MutableInteractionSource that will be used to emit PressInteraction.Press when this clickable is pressed. Only the initial (first) press will be recorded and emitted with MutableInteractionSource. If null, and there is an indicationNodeFactory provided, an internal MutableInteractionSource will be created when required.

indicationNodeFactory: IndicationNodeFactory?

the IndicationNodeFactory used to optionally render Indication inside this node, instead of using a separate Modifier.indication. This should be preferred for performance reasons over using Modifier.indication separately.

enabled: Boolean

Controls the enabled state. When false, onClick, onLongClick or onDoubleClick won't be invoked

onClickLabel: String?

semantic / accessibility label for the onClick action

role: Role?

the type of user interface element. Accessibility services might use this to describe the element or do customizations