The second Android 11 Developer Preview is now available, test it out and share your feedback.

Placeable

abstract class Placeable
kotlin.Any
   ↳ androidx.ui.core.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

Public constructors

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

Public methods

abstract operator IntPx?

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

Protected methods

abstract Unit

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

Companion functions

Unit

Place a Placeable at position in its parent's coordinate system.

Unit

Place a Placeable at position in its parent's coordinate system.

Unit

Place a Placeable at x, y in its parent's coordinate system.

Unit
Placeable.place(x: Px, y: Px)

Place a Placeable at x, y in its parent's coordinate system.

Unit

Place a Placeable at position in its parent's coordinate system.

Unit

Place a Placeable at position in its parent's coordinate system.

Unit

Place a Placeable at x, y in its parent's coordinate system.

Unit

Place a Placeable at x, y in its parent's coordinate system.

Properties

IntPx

The height, in pixels, of the measured layout.

abstract IntPxSize

The measured size of this Placeable.

IntPx

The width, in pixels, of the measured layout.

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): IntPx?

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

Protected methods

performPlace

protected abstract fun performPlace(position: IntPxPosition): Unit

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

Properties

height

val height: IntPx

The height, in pixels, of the measured layout. This is the height value passed into MeasureScope.layout.

size

abstract val size: IntPxSize

The measured size of this Placeable.

width

val width: IntPx

The width, in pixels, of the measured layout. This is the width value passed into MeasureScope.layout.

Companion functions

place

fun Placeable.place(position: IntPxPosition): Unit

Place a Placeable at position in its parent's coordinate system. If the layout direction is right-to-left, the given position will be horizontally mirrored so that the position of the Placeable implicitly reacts to RTL layout direction contexts. If this method is used outside the MeasureScope.layout positioning block, the automatic position mirroring will not happen and the Placeable will be placed at the given position, similar to the placeAbsolute method.

place

fun Placeable.place(position: PxPosition): Unit

Place a Placeable at position in its parent's coordinate system. If the layout direction is right-to-left, the given position will be horizontally mirrored so that the position of the Placeable implicitly reacts to RTL layout direction contexts. If this method is used outside the MeasureScope.layout positioning block, the automatic position mirroring will not happen and the Placeable will be placed at the given position, similar to the placeAbsolute method.

place

fun Placeable.place(
    x: IntPx,
    y: IntPx
): Unit

Place a Placeable at x, y in its parent's coordinate system. If the layout direction is right-to-left, the given position will be horizontally mirrored so that the position of the Placeable implicitly reacts to RTL layout direction contexts. If this method is used outside the MeasureScope.layout positioning block, the automatic position mirroring will not happen and the Placeable will be placed at the given position, similar to the placeAbsolute method.

place

fun Placeable.place(
    x: Px,
    y: Px
): Unit

Place a Placeable at x, y in its parent's coordinate system. If the layout direction is right-to-left, the given position will be horizontally mirrored so that the position of the Placeable implicitly reacts to RTL layout direction contexts. If this method is used outside the MeasureScope.layout positioning block, the automatic position mirroring will not happen and the Placeable will be placed at the given position, similar to the placeAbsolute method.

placeAbsolute

fun Placeable.placeAbsolute(position: IntPxPosition): Unit

Place a Placeable at position in its parent's coordinate system. Unlike place, the given position will not implicitly react in RTL layout direction contexts.

placeAbsolute

fun Placeable.placeAbsolute(position: PxPosition): Unit

Place a Placeable at position in its parent's coordinate system. Unlike place, the given position will not implicitly react in RTL layout direction contexts.

placeAbsolute

fun Placeable.placeAbsolute(
    x: IntPx,
    y: IntPx
): Unit

Place a Placeable at x, y in its parent's coordinate system. Unlike place, the given position will not implicitly react in RTL layout direction contexts.

placeAbsolute

fun Placeable.placeAbsolute(
    x: Px,
    y: Px
): Unit

Place a Placeable at x, y in its parent's coordinate system. Unlike place, the given position will not implicitly react in RTL layout direction contexts.