Compose Modifier
Common
fun Modifier.sizeIn(
minWidth: Dp = Dp.Unspecified,
minHeight: Dp = Dp.Unspecified,
maxWidth: Dp = Dp.Unspecified,
maxHeight: Dp = Dp.Unspecified,
) =
this.then(
SizeElement(
minWidth = minWidth,
minHeight = minHeight,
maxWidth = maxWidth,
maxHeight = maxHeight,
enforceIncoming = true,
inspectorInfo =
debugInspectorInfo {
name = "sizeIn"
properties["minWidth"] = minWidth
properties["minHeight"] = minHeight
properties["maxWidth"] = maxWidth
properties["maxHeight"] = maxHeight
},
)
)
Constrain the width of the content to be between minWidthdp and maxWidthdp and the height of the content to be between minHeightdp and maxHeightdp as permitted by the incoming measurement Constraints. If the incoming constraints are more restrictive the requested size will obey the incoming constraints and attempt to be as close as possible to the preferred size.