SizeSchema

@Serializable
data class SizeSchema(val width: SizeSchema.Behavior.Horizontal, val height: SizeSchema.Behavior.Vertical)

Defines the width and height constraints for a tile.

Width behaviors (Behavior.Horizontal):

Height behaviors (Behavior.Vertical):

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

Constructors

Link copied to clipboard

Types

Link copied to clipboard
@Serializable
@SerialName(value = "behavior")
sealed interface Behavior

Properties

Link copied to clipboard
@SerialName(value = "height")
val height: SizeSchema.Behavior.Vertical
Link copied to clipboard
@SerialName(value = "width")
val width: SizeSchema.Behavior.Horizontal