MeasureScope
-
Cmn
@MeasureScopeMarker
interface MeasureScope : IntrinsicMeasureScope
ApproachMeasureScope |
|
LazyLayoutMeasureScope |
The receiver scope of a |
SubcomposeMeasureScope |
The receiver scope of a |
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
Public functions |
||
|---|---|---|
open MeasureResult |
layout(Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic. |
Cmn
|
open MeasureResult |
layout(Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic. |
Cmn
|
Inherited functions |
|||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||||||||||||||||||
Inherited properties |
||||||
|---|---|---|---|---|---|---|
|
Public functions
layout
open fun layout(
width: Int,
height: Int,
alignmentLines: Map<AlignmentLine, Int> = emptyMap(),
placementBlock: Placeable.PlacementScope.() -> Unit
): 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.placeAt 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 |
layout
open fun layout(
width: Int,
height: Int,
alignmentLines: Map<AlignmentLine, Int> = emptyMap(),
rulers: (RulerScope.() -> Unit)? = null,
placementBlock: Placeable.PlacementScope.() -> Unit
): 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.placeAt 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 |
rulers: (RulerScope.() -> Unit)? = null |
a method to set Ruler values used by all placed children |
placementBlock: Placeable.PlacementScope.() -> Unit |
block defining the children positioning of the current layout |