MeasureScope

interface MeasureScope : Density


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

Based on androidx.compose.ui.layout.MeasureScope.

Summary

Public functions

open MeasureResult
layout(width: Int, height: Int, depth: Int, 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.

Public properties

open Float
open Float

Inherited functions

From androidx.compose.ui.unit.Density
open Int
open Int
open Dp
open Dp
open DpSize
open Float
open Float
open Rect
open Size
open TextUnit
open TextUnit

Public functions

layout

Added in 1.0.0-alpha01
open fun layout(width: Int, height: Int, depth: Int, 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.

Parameters
width: Int

the measured width of the layout, in pixels

height: Int

the measured height of the layout, in pixels

depth: Int

the measured depth of the layout, in pixels

placementBlock: Placeable.PlacementScope.() -> Unit

block defining the children positioning of the current layout

Public properties

density

Added in 1.0.0-alpha01
open val densityFloat

fontScale

Added in 1.0.0-alpha01
open val fontScaleFloat