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

Placeable

abstract class Placeable
kotlin.Any
   ↳ androidx.compose.ui.Placeable

A Placeable corresponds to a child layout that can be positioned by its parent layout. Most Placeables are the result of a Measurable.measure call.

A Placeable should never be stored between measure calls.

Summary

Nested classes
abstract

Receiver scope that permits explicit placement of a Placeable.

Public constructors

A Placeable corresponds to a child layout that can be positioned by its parent layout.

Public methods
abstract operator Int

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

Protected methods
abstract Unit
placeAt(position: IntOffset)

Positions the Placeable at position in its parent's coordinate system.

Properties
IntOffset

The offset to be added to an apparent position assigned to this Placeable to make it real.

Int

The height, in pixels, of the measured layout, as seen by the parent.

IntSize

The measured size of this Placeable.

Constraints

The constraints used for the measurement made to obtain this Placeable.

Int

The width, in pixels, of the measured layout, as seen by the parent.

Public constructors

<init>

Placeable()

A Placeable corresponds to a child layout that can be positioned by its parent layout. Most Placeables are the result of a Measurable.measure call.

A Placeable should never be stored between measure calls.

Public methods

get

abstract operator fun get(line: AlignmentLine): Int

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

Protected methods

placeAt

protected abstract fun placeAt(position: IntOffset): Unit

Positions the Placeable at position in its parent's coordinate system.

Properties

apparentToRealOffset

protected val apparentToRealOffset: IntOffset

The offset to be added to an apparent position assigned to this Placeable to make it real. The real layout will be centered on the space assigned by the parent, which computed the child's position only seeing its apparent size.

height

var height: Int

The height, in pixels, of the measured layout, as seen by the parent. This is usually the height value passed into MeasureScope.layout, but can be different if the layout does not respect its incoming constraints, so the height will be coerced inside the min and max height.

measuredSize

protected var measuredSize: IntSize

The measured size of this Placeable. This might not respect measurementConstraints.

measurementConstraints

protected var measurementConstraints: Constraints

The constraints used for the measurement made to obtain this Placeable.

width

var width: Int

The width, in pixels, of the measured layout, as seen by the parent. This is usually the width value passed into MeasureScope.layout, but will be different if the layout does not respect its incoming constraints, so the width will be coerced inside the min and max width.