SizeSchema
Defines the width and height constraints for a tile.
Width behaviors (Behavior.Horizontal):
Behavior.Horizontal.Fill —
fillMaxWidth(). Optional Fill.max adds awidthIn(max=)cap (dp).Behavior.Horizontal.Wrap —
wrapContentWidth().Behavior.Horizontal.Fixed —
width(value.dp).Behavior.Horizontal.Weight —
Modifier.weight(value)inside aRowparent. Requires aLocalRowScopeorLocalFlowRowScopeto be active; has no effect outside a Row/FlowRow.Behavior.Horizontal.Span —
gridItem(rowSpan = value)inside aGridparent. RequiresLocalGridScope; no effect outside a Grid.Behavior.Horizontal.Flex — Flexbox-specific control (grow, shrink, basis, alignSelf, order). Requires
LocalFlexBoxScope; no effect outside a FlexBox.
Height behaviors (Behavior.Vertical):
Behavior.Vertical.Fill —
fillMaxHeight(). Optional Behavior.Vertical.Fill.max addsheightIn(max=)cap.Behavior.Vertical.Wrap —
wrapContentHeight().Behavior.Vertical.Fixed —
height(value.dp).Behavior.Vertical.Weight —
Modifier.weight(value)inside aColumn. RequiresLocalColumnScope.Behavior.Vertical.Span —
gridItem(rowSpan = value)inside aGrid. RequiresLocalGridScope.Behavior.Vertical.FillRow —
fillMaxRowHeight(fraction)inside aFlowRow. RequiresLocalFlowRowScope; defaults tofraction = 1f(full row height).
DSL helpers (mosaic-server):
size(width = fillHorizontally()) // Fill, no cap
size(width = fillHorizontally(max = 400)) // Fill with 400dp cap
size(width = wrapHorizontally())
size(width = fixedHorizontally(200))
size(width = weightHorizontally(1f)) // only effective inside Row
size(width = spanHorizontally(2)) // only effective inside Grid
size(width = flexHorizontally(...)) // only effective inside FlexBox
size(height = fillVertically())
size(height = fillVertically(max = 300))
size(height = wrapVertically())
size(height = fixedVertically(56))
size(height = weightVertically(1f)) // only effective inside Column
size(height = fillRowHeight()) // only effective inside FlowRow
size(height = fillRowHeight(0.5f)) // 50% of row height