Google is committed to advancing racial equity for Black communities. See how.

LayoutNode

class LayoutNode : Measurable, Remeasurement, OwnerScope, LayoutInfo
kotlin.Any
   ↳ androidx.compose.ui.node.LayoutNode

An element in the layout hierarchy, built with compose UI.

Summary

Public methods
Unit

Performs the node remeasuring synchronously even if the node was not marked as needs remeasure before.

List<ModifierInfo>

This returns a new List of Modifiers and the coordinates and any extra information that may be useful.

Int

Calculates the smallest height beyond which increasing the height never decreases the width.

Int

Calculates the smallest width beyond which increasing the width never decreases the height.

Placeable
measure(constraints: Constraints)

Measures the layout with constraints, returning a Placeable layout that has its new size.

Int

Calculates the minimum height that the layout can be such that the content of the layout will be painted correctly.

Int

Calculates the minimum width that the layout can be such that the content of the layout will be painted correctly.

String

Properties
LayoutCoordinates

Coordinates of just the contents of the LayoutNode, after being affected by all modifiers.

Int

The measured height of this layout and all of its modifiers.

Boolean

Returns true if this LayoutNode currently has an LayoutNode.owner.

Boolean

Whether or not this LayoutNode and all of its parents have been placed in the hierarchy.

Boolean

true when the scope is still in the hierarchy and false once it has been removed and observations are no longer necessary.

Any?

Data provided by the ParentData

LayoutInfo?

Parent of this layout.

Int

The measured width of this layout and all of its modifiers.

Inherited extension properties
From androidx.compose.ui.layout
Any?

Any?

Retrieves the tag associated to a composable with the Modifier.layoutId modifier.

Public methods

forceRemeasure

fun forceRemeasure(): Unit

Performs the node remeasuring synchronously even if the node was not marked as needs remeasure before. Useful for cases like when during scrolling you need to re-execute the measure block to consume the scroll offset and remeasure your children in a blocking way.

getModifierInfo

fun getModifierInfo(): List<ModifierInfo>

This returns a new List of Modifiers and the coordinates and any extra information that may be useful. This is used for tooling to retrieve layout modifier and layer information.

maxIntrinsicHeight

fun maxIntrinsicHeight(width: Int): Int

Calculates the smallest height beyond which increasing the height never decreases the width.

maxIntrinsicWidth

fun maxIntrinsicWidth(height: Int): Int

Calculates the smallest width beyond which increasing the width never decreases the height.

measure

fun measure(constraints: Constraints): Placeable

Measures the layout with constraints, returning a Placeable layout that has its new size. A Measurable can only be measured once inside a layout pass.

minIntrinsicHeight

fun minIntrinsicHeight(width: Int): Int

Calculates the minimum height that the layout can be such that the content of the layout will be painted correctly.

minIntrinsicWidth

fun minIntrinsicWidth(height: Int): Int

Calculates the minimum width that the layout can be such that the content of the layout will be painted correctly.

toString

fun toString(): String

Properties

coordinates

val coordinates: LayoutCoordinates

Coordinates of just the contents of the LayoutNode, after being affected by all modifiers.

height

val height: Int

The measured height of this layout and all of its modifiers. Shortcut for size.height.

isAttached

val isAttached: Boolean

Returns true if this LayoutNode currently has an LayoutNode.owner. Semantically, this means that the LayoutNode is currently a part of a component tree.

isPlaced

var isPlaced: Boolean

Whether or not this LayoutNode and all of its parents have been placed in the hierarchy.

isValid

val isValid: Boolean

true when the scope is still in the hierarchy and false once it has been removed and observations are no longer necessary.

parentData

val parentData: Any?

Data provided by the ParentData

parentInfo

val parentInfo: LayoutInfo?

Parent of this layout.

width

val width: Int

The measured width of this layout and all of its modifiers. Shortcut for size.width.