LayoutInfo


The public information about the layouts used internally as nodes in the Compose UI hierarchy.

Summary

Constants

const Int

Marks a LayoutInfo as not placed in placeOrder.

Cmn

Public functions

List<ModifierInfo>

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

Cmn

Public properties

LayoutCoordinates

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

Cmn
Density

The density in use for this layout.

Cmn
Int

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

Cmn
Boolean

Returns true if this layout is currently a part of the layout tree.

Cmn
open Boolean

True if the node is deactivated.

Cmn
Boolean

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

Cmn
open Boolean

A layout node that is ignored by the layout system.

Cmn
LayoutDirection

The layout direction in use for this layout.

Cmn
LayoutInfo?

Parent of this layout.

Cmn
open Int

Orders this layout among siblings placed by the same parent during layout.

Cmn
Int

Unique and stable id representing this node to the semantics system.

Cmn
ViewConfiguration

The ViewConfiguration in use for this layout.

Cmn
Int

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

Cmn
open Float

The zIndex of this layout node, defining the drawing order.

Cmn

Extension functions

Unit

Calculates the bounds of this layout in root coordinates, including all of its modifiers (padding, size, border, and so on), writing the result into rect.

Cmn

Extension properties

Boolean

Whether this layout is drawn fully transparent by an ancestor: the layer of its outermost modifier, or a layer of any ancestor layout, has an alpha of 0 or less.

Cmn
View?

Return the owner as a View from the associated LayoutNode.

android
SemanticsPropertyProvider?

The unmerged semantics configuration of this layout, or null if it has no semantics modifiers.

Cmn

Constants

NotPlacedPlaceOrder

@ExperimentalComposeUiHostApi
const val NotPlacedPlaceOrder: Int

Marks a LayoutInfo as not placed in placeOrder.

placeOrder returns this value when isPlaced is false.

Public functions

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.

Public properties

coordinates

val coordinates: LayoutCoordinates

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

density

val density: Density

The density in use for this layout.

height

val height: Int

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

isAttached

val isAttached: Boolean

Returns true if this layout is currently a part of the layout tree.

isDeactivated

open val isDeactivated: Boolean

True if the node is deactivated. For example, the children of androidx.compose.ui.layout.SubcomposeLayout which are retained to be reused in future are considered deactivated.

isPlaced

val isPlaced: Boolean

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

isVirtual

open val isVirtual: Boolean

A layout node that is ignored by the layout system.

layoutDirection

val layoutDirection: LayoutDirection

The layout direction in use for this layout.

parentInfo

val parentInfo: LayoutInfo?

Parent of this layout.

placeOrder

@ExperimentalComposeUiHostApi
open val placeOrder: Int

Orders this layout among siblings placed by the same parent during layout.

Placed children receive sequential values starting from 0, or NotPlacedPlaceOrder when not placed (isPlaced is false).

semanticsId

val semanticsId: Int

Unique and stable id representing this node to the semantics system.

viewConfiguration

val viewConfiguration: ViewConfiguration

The ViewConfiguration in use for this layout.

width

val width: Int

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

zIndex

@ExperimentalComposeUiHostApi
open val zIndex: Float

The zIndex of this layout node, defining the drawing order.

Extension functions

LayoutInfo.calculateOuterBoundsInRoot

@ExperimentalComposeUiHostApi
fun LayoutInfo.calculateOuterBoundsInRoot(rect: MutableRect): Unit

Calculates the bounds of this layout in root coordinates, including all of its modifiers (padding, size, border, and so on), writing the result into rect. Bounds are not clipped.

These are the bounds the layout occupies in its parent, transformed to the root. If this layout isn't attached, rect is set to (0, 0, 0, 0).

Parameters
rect: MutableRect

The MutableRect into which the bounds are written.

Extension properties

LayoutInfo.isTransparent

@ExperimentalComposeUiHostApi
val LayoutInfo.isTransparent: Boolean

Whether this layout is drawn fully transparent by an ancestor: the layer of its outermost modifier, or a layer of any ancestor layout, has an alpha of 0 or less.

Layers inside this layout's own modifier chain are not considered, so Modifier.alpha(0f) applied after other modifiers on this layout doesn't make it transparent.

LayoutInfo.view

val LayoutInfo.view: View?

Return the owner as a View from the associated LayoutNode.

LayoutInfo.semanticsConfiguration

@ExperimentalComposeUiHostApi
val LayoutInfo.semanticsConfiguration: SemanticsPropertyProvider?

The unmerged semantics configuration of this layout, or null if it has no semantics modifiers.

Reads existing state; doesn't allocate.