The Android Developer Challenge is back! Submit your idea before December 2.

LayoutCoordinates

interface LayoutCoordinates
androidx.ui.core.LayoutCoordinates

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

Summary

Public methods

abstract PxPosition

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

abstract PxPosition

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

abstract PxPosition

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

abstract PxPosition

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

Properties

abstract LayoutCoordinates?

The coordinates of the parent layout.

abstract PxPosition

The position within the parent of this layout.

abstract Map<AlignmentLine, IntPx>

The alignment lines provided for this layout, relative to the current layout.

abstract PxSize

The size of this layout in the local coordinates space.

Extension properties

From androidx.ui.core
PxPosition

The global position of this layout.

PxPosition

The position of this layout inside the root composable.

Public methods

childToLocal

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

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

globalToLocal

abstract fun globalToLocal(global: PxPosition
): PxPosition

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

localToGlobal

abstract fun localToGlobal(local: PxPosition
): PxPosition

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

localToRoot

abstract fun localToRoot(local: PxPosition
): PxPosition

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

Properties

parentCoordinates

abstract val parentCoordinates: LayoutCoordinates?

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

position

abstract val position: PxPosition

The position within the parent of this layout.

providedAlignmentLines

abstract val providedAlignmentLines: Map<AlignmentLine, IntPx>

The alignment lines provided for this layout, relative to the current layout. This map does not contain inherited lines.

size

abstract val size: PxSize

The size of this layout in the local coordinates space.