Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

LayoutCoordinates

interface LayoutCoordinates
androidx.compose.ui.layout.LayoutCoordinates

A holder of the measured bounds for the layout (MeasureBox).

Summary

Public methods
abstract Rect

Returns the child bounding box, discarding clipped rectangles, in local coordinates.

abstract Offset
childToLocal(child: LayoutCoordinates, childLocal: Offset)

Converts a child layout position into a local position within this layout.

abstract operator Int

Returns the position of an alignment line, or AlignmentLine.Unspecified if the line is not provided.

abstract Offset

Converts a global position into a local position within this layout.

abstract Offset

Converts a local position within this layout into a global one.

abstract Offset

Converts a local position within this layout into an offset from the root composable.

Properties
abstract Boolean

Returns false if the corresponding layout was detached from the hierarchy.

abstract LayoutCoordinates?

The coordinates of the parent layout.

abstract Set<AlignmentLine>

The alignment lines provided for this layout, not including inherited lines.

abstract IntSize

The size of this layout in the local coordinates space.

Extension properties
From androidx.compose.ui.layout
Rect

Returns the bounding box of the child in the parent's content area, including any clipping done with respect to the parent.

Rect

The boundaries of this layout inside the root composable.

Rect

The global boundaries of this layout inside.

Offset

The global position of this layout.

Offset

Returns the position of the top-left in the parent's content area or (0, 0) for the root.

Offset

The position of this layout inside the root composable.

Public methods

childBoundingBox

abstract fun childBoundingBox(child: LayoutCoordinates): Rect

Returns the child bounding box, discarding clipped rectangles, in local coordinates.

childToLocal

abstract fun childToLocal(
    child: LayoutCoordinates,
    childLocal: Offset
): Offset

Converts a child layout position into a local position within this layout.

get

abstract operator fun get(line: AlignmentLine): Int

Returns the position of an alignment line, or AlignmentLine.Unspecified if the line is not provided.

globalToLocal

abstract fun globalToLocal(global: Offset): Offset

Converts a global position into a local position within this layout.

localToGlobal

abstract fun localToGlobal(local: Offset): Offset

Converts a local position within this layout into a global one.

localToRoot

abstract fun localToRoot(local: Offset): Offset

Converts a local position within this layout into an offset from the root composable.

Properties

isAttached

abstract val isAttached: Boolean

Returns false if the corresponding layout was detached from the hierarchy.

parentCoordinates

abstract val parentCoordinates: LayoutCoordinates?

The coordinates of the parent layout. Null if there is no parent.

providedAlignmentLines

abstract val providedAlignmentLines: Set<AlignmentLine>

The alignment lines provided for this layout, not including inherited lines.

size

abstract val size: IntSize

The size of this layout in the local coordinates space.