Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

MeasureScope

abstract class MeasureScope : IntrinsicMeasureScope
kotlin.Any
   ↳ androidx.ui.core.IntrinsicMeasureScope
   ↳ androidx.ui.core.MeasureScope

The receiver scope of a layout's measure lambda. The return value of the measure lambda is MeasureResult, which should be returned by layout

Summary

Nested classes
abstract

Interface holding the size and alignment lines of the measured layout, as well as the children positioning logic.

Public constructors

The receiver scope of a layout's measure lambda.

Public methods
MeasureScope.MeasureResult
layout(width: Int, height: Int, alignmentLines: Map<AlignmentLine, Int> = emptyMap(), placementBlock: Placeable.PlacementScope.() -> Unit)

Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic.

Placeable

Measures the layout with constraints, returning a Placeable layout that has its new size.

Inherited functions
Inherited extension functions
From androidx.ui.layout
Constraints

Creates the Constraints corresponding to the current DpConstraints.

DpConstraints

Creates the DpConstraints corresponding to the current Constraints.

Inherited properties

Public constructors

<init>

MeasureScope()

The receiver scope of a layout's measure lambda. The return value of the measure lambda is MeasureResult, which should be returned by layout

Public methods

layout

fun layout(
    width: Int,
    height: Int,
    alignmentLines: Map<AlignmentLine, Int> = emptyMap(),
    placementBlock: Placeable.PlacementScope.() -> Unit
): MeasureScope.MeasureResult

Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic. The placementBlock is a lambda used for positioning children. Placeable.place should be called on children inside placementBlock. The alignmentLines can be used by the parent layouts to decide layout, and can be queried using the Placeable.get operator. Note that alignment lines will be inherited by parent layouts, such that indirect parents will be able to query them as well.

Parameters
width: Int the measured width of the layout
height: Int the measured height of the layout
alignmentLines: Map<AlignmentLine, Int> = emptyMap() the alignment lines defined by the layout
placementBlock: Placeable.PlacementScope.() -> Unit block defining the children positioning of the current layout

measure

fun Measurable.measure(constraints: Constraints): Placeable

Measures the layout with constraints, returning a Placeable layout that has its new size. A Measurable can only be measured once inside a layout pass. The layout will inherit the layout direction from its parent layout.