Constraints¶
@Immutable
class Constraints(
val minWidth: Int = 0,
val maxWidth: Int = Int.MAX_VALUE,
val minHeight: Int = 0,
val maxHeight: Int = Int.MAX_VALUE
)
Immutable size constraints passed from a parent layout to its children during measurement.
A child must produce a size whose width is in [minWidth, maxWidth] and whose height is in [minHeight, maxHeight]. Use copy to derive a modified copy with some dimensions changed, and offset to shrink the available space by a fixed amount (e.g. for padding).
Constructors¶
Constraints¶
Properties¶
maxHeight¶
maxWidth¶
minHeight¶
minWidth¶
Functions¶
copy¶
offset¶
@Stable
fun Constraints.offset(horizontal: Int = 0, vertical: Int = 0): Constraints
Returns a copy of these Constraints expanded or shrunk by horizontal pixels on each horizontal side and vertical pixels on each vertical side.
Negative values shrink the available space (useful for padding). maxWidth and maxHeight are never reduced below zero.