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

LayoutCoordinatesKt

public final class LayoutCoordinatesKt


Summary

Public methods

static final @NonNull Rect

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

static final @NonNull Rect

The boundaries of this layout inside the root composable.

static final @NonNull Rect

The boundaries of this layout relative to the window's origin.

static final @NonNull LayoutCoordinates

Walks up the LayoutCoordinates hierarchy to find the LayoutCoordinates whose LayoutCoordinates.parentCoordinates is null and returns it.

static final @NonNull Offset

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

static final @NonNull Offset

The position of this layout inside the root composable.

static final @NonNull Offset

The position of this layout relative to the window.

Public methods

boundsInParent

public static final @NonNull Rect boundsInParent(@NonNull LayoutCoordinates receiver)

Returns the bounding box of the child in the parent's content area, including any clipping done with respect to the parent. For the root, the bounds is positioned at (0, 0) and sized to the size of the root.

boundsInRoot

public static final @NonNull Rect boundsInRoot(@NonNull LayoutCoordinates receiver)

The boundaries of this layout inside the root composable.

boundsInWindow

public static final @NonNull Rect boundsInWindow(@NonNull LayoutCoordinates receiver)

The boundaries of this layout relative to the window's origin.

findRootCoordinates

public static final @NonNull LayoutCoordinates findRootCoordinates(@NonNull LayoutCoordinates receiver)

Walks up the LayoutCoordinates hierarchy to find the LayoutCoordinates whose LayoutCoordinates.parentCoordinates is null and returns it. If LayoutCoordinates.isAttached, this will have the size of the androidx.compose.ui.platform.ComposeView.

positionInParent

public static final @NonNull Offset positionInParent(@NonNull LayoutCoordinates receiver)

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

positionInRoot

public static final @NonNull Offset positionInRoot(@NonNull LayoutCoordinates receiver)

The position of this layout inside the root composable.

positionInWindow

public static final @NonNull Offset positionInWindow(@NonNull LayoutCoordinates receiver)

The position of this layout relative to the window.