{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

DelegatableNode

Known direct subclasses
CompositionLocalConsumerModifierNode

Implementing this interface allows your Modifier.Node subclass to read CompositionLocals via the currentValueOf function.

DrawModifierNode

A Modifier.Node that draws into the space of the layout.

FocusEventModifierNode

Implement this interface create a modifier node that can be used to observe focus state changes to a FocusTargetNode down the hierarchy.

FocusPropertiesModifierNode

Implement this interface create a modifier node that can be used to modify the focus properties of the associated FocusTargetNode.

FocusRequesterModifierNode

Implement this interface to create a modifier node that can be used to request changes in the focus state of a FocusTargetNode down the hierarchy.

FocusTargetModifierNode

This modifier node can be used to create a modifier that makes a component focusable.

GlobalPositionAwareModifierNode

A androidx.compose.ui.Modifier.Node whose onGloballyPositioned is called with the final LayoutCoordinates of the Layout when the global position of the content may have changed.

KeyInputModifierNode

Implement this interface to create a Modifier.Node that can intercept hardware Key events.

LayoutAwareModifierNode

A androidx.compose.ui.Modifier.Node which receives various callbacks in response to local changes in layout.

LayoutModifierNode

A Modifier.Node that changes how its wrapped content is measured and laid out.

Modifier.Node

The longer-lived object that is created for each Modifier.Element applied to a androidx.compose.ui.layout.Layout.

ModifierLocalModifierNode

A androidx.compose.ui.Modifier.Node that is capable of consuming and providing ModifierLocal values.

ObserverModifierNode

Modifier.Nodes that implement ObserverNode can provide their own implementation of onObservedReadsChanged that will be called whenever the value of read object has changed.

ParentDataModifierNode

A Modifier.Node that provides data to the parent Layout.

PointerInputModifierNode

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.

RotaryInputModifierNode

Implement this interface to create a Modifier.Node that can intercept rotary scroll events.

SemanticsModifierNode

A Modifier.Node that adds semantics key/value for use in testing, accessibility, and similar use cases.

SoftKeyboardInterceptionModifierNode

Implement this interface to create a Modifier.Node that can intercept hardware Key events before they are sent to the software keyboard.

Known indirect subclasses
CacheDrawModifierNode

Expands on the androidx.compose.ui.node.DrawModifierNode by adding the ability to invalidate the draw cache for changes in things like shapes and bitmaps (see Modifier.border for a usage examples).

DelegatingNode

A Modifier.Node which is able to delegate work to other Modifier.Node instances.

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


Represents a Modifier.Node which can be a delegate of another Modifier.Node. Since Modifier.Node implements this interface, in practice any Modifier.Node can be delegated.

See also
DelegatingNode
delegate

Summary

Public properties

Modifier.Node

A reference of the Modifier.Node that holds this node's position in the node hierarchy.

Cmn

Extension functions

Unit

Invalidates the subtree of this layout, including layout, drawing, parent data, etc.

Cmn
Density

Returns the current Density of the LayoutNode that this DelegatableNode is attached to.

Cmn
LayoutDirection

Returns the current LayoutDirection of the LayoutNode that this DelegatableNode is attached to.

Cmn

Public properties

node

val nodeModifier.Node

A reference of the Modifier.Node that holds this node's position in the node hierarchy. If the node is a delegate of another node, this will point to that node. Otherwise, this will point to itself.

Extension functions

invalidateSubtree

fun DelegatableNode.invalidateSubtree(): Unit

Invalidates the subtree of this layout, including layout, drawing, parent data, etc.

Calling this method can be a relatively expensive operation as it will cause the entire subtree to relayout and redraw instead of just parts that are otherwise invalidated. Its use should be limited to structural changes.

requireDensity

fun DelegatableNode.requireDensity(): Density

Returns the current Density of the LayoutNode that this DelegatableNode is attached to. If the node is not attached, this function will throw an IllegalStateException.

requireLayoutDirection

fun DelegatableNode.requireLayoutDirection(): LayoutDirection

Returns the current LayoutDirection of the LayoutNode that this DelegatableNode is attached to. If the node is not attached, this function will throw an IllegalStateException.