MeasuredSizeAwareModifierNode

Known direct subclasses
LayoutAwareModifierNode

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

Known indirect subclasses
DragAndDropSourceModifierNode

A Modifier.Node that can be used as a source for platform drag and drop operations.

DragAndDropTargetModifierNode

A Modifier.Node that can be used as a target for platform drag and drop operations.


A androidx.compose.ui.Modifier.Node which receives a callback with the layout's measured size.

This is the androidx.compose.ui.Modifier.Node equivalent of androidx.compose.ui.layout.OnRemeasuredModifier.

Example usage:

import androidx.compose.material.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.onSizeChanged

// Use onSizeChanged() for diagnostics. Use Layout or SubcomposeLayout if you want
// to use the size of one component to affect the size of another component.
Text(
    "Hello $name",
    Modifier.onSizeChanged { size -> println("The size of the Text in pixels is $size") },
)

Summary

Public functions

Unit

This method is called when the layout content is remeasured.

Cmn

Inherited functions

From androidx.compose.ui.node.DelegatableNode
open Unit

Invoked when the density changes for this node.

Cmn
open Unit

Invoked when the layout direction changes for this node.

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

onRemeasured

fun onRemeasured(size: IntSize): Unit

This method is called when the layout content is remeasured. The most common usage is onSizeChanged.