RulerScope
-
Cmn
@MeasureScopeMarker
interface RulerScope : Density
A scope used in MeasureScope.layout for the rulers parameter to allow a layout to define Ruler values for children.
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.safeContent import androidx.compose.ui.Modifier import androidx.compose.ui.layout.layout val safeInsets = WindowInsets.safeContent Box( Modifier.fillMaxSize().layout { measurable, constraints -> val placeable = measurable.measure(constraints) layout( width = placeable.width, height = placeable.height, rulers = { val height = coordinates.size.height SafeBottomRuler provides (height - safeInsets.getBottom(this)).toFloat() }, ) { placeable.place(0, 0) } }, content = content, )
Summary
Public functions |
||
|---|---|---|
infix Unit |
Provides a constant value for a |
Cmn
|
infix Unit |
VerticalRuler.providesRelative(value: Float)Provides a |
Cmn
|
Public properties |
||
|---|---|---|
LayoutCoordinates |
|
Cmn
|
Inherited functions |
|||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||||||||||||||||||
Inherited properties |
|---|
Public functions
providesRelative
infix fun VerticalRuler.providesRelative(value: Float): Unit
Provides a VerticalRuler value that is relative to the left side in an LTR layout or right side on an RTL layout.
Public properties
coordinates
val coordinates: LayoutCoordinates
LayoutCoordinates of the position in the hierarchy that the Ruler will be provided.