androidx.compose.ui.node
PointerInputModifierNode
Interface · from org.jetbrains.compose.ui:ui:1.12.2
No hand-written docs yet.
A androidx.compose.ui.Modifier.Node that receives PointerInputChanges, interprets them, and consumes the aspects of the changes that it is react to such that other PointerInputModifierNodes don't also react to them.
interface PointerInputModifierNode : DelegatableNode
Is a
Properties
touchBoundsExpansionSince 1.8
val touchBoundsExpansion: TouchBoundsExpansion
Override this value to expand the touch bounds of this PointerInputModifierNode by the given value in align each edge. It only applies to this pointer input modifier and won't impact other pointer input modifiers on the same LayoutNode. Also note that a pointer in expanded touch bounds can't be intercepted by its parents and ancestors even if their interceptOutOfBoundsChildEvents returns true.
Functions
onPointerEvent
fun onPointerEvent(
pointerEvent: PointerEvent,
pass: PointerEventPass,
bounds: IntSize,
)
Invoked when pointers that previously hit this PointerInputModifierNode have changed. It is expected that any PointerInputChanges that are used during this event and should not be considered valid to be used in other nodes should be marked as consumed by calling PointerInputChange.consume.
onCancelPointerInput
fun onCancelPointerInput()
Invoked to notify the handler that no more calls to PointerInputModifierNode will be made, until at least new pointers exist. This can occur for a few reasons: 1. Android dispatches ACTION_CANCEL to Compose. 2. This PointerInputModifierNode is no longer associated with a LayoutNode. 3. This PointerInputModifierNode's associated LayoutNode is no longer in the composition tree.
interceptOutOfBoundsChildEvents
fun interceptOutOfBoundsChildEvents(): Boolean
Intercept pointer input that children receive even if the pointer is out of bounds.
sharePointerInputWithSiblings
fun sharePointerInputWithSiblings(): Boolean
If false, then this PointerInputModifierNode will not allow siblings under it to respond to events. If true, this will have the first chance to respond and the next sibling under will then get a chance to respond as well. This trigger acts at the Layout level, so if any PointerInputModifierNodes on a Layout has sharePointerInputWithSiblings set to true then the Layout will share with siblings.
onViewConfigurationChange
fun onViewConfigurationChange()
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).
Library docs
A androidx.compose.ui.Modifier.Node that receives PointerInputChanges, interprets them, and
consumes the aspects of the changes that it is react to such that other
PointerInputModifierNodes don't also react to them.
This is the androidx.compose.ui.Modifier.Node equivalent of
androidx.compose.ui.input.pointer.PointerInputFilter.