Compose Unstyled 2.0 is out! Check the official announcement blog ->
Function

transformingResizable

When the resizable modifier is present and enabled, UI controls will be shown that allow the user to resize the element in 3D space.

transformingResizable

Source set: Android
public fun SubspaceModifier.transformingResizable(
    enabled: Boolean = true,
    minimumSize: DpVolumeSize = DpVolumeSize.Zero,
    maximumSize: DpVolumeSize = DpVolumeSize(Dp.Infinity, Dp.Infinity, Dp.Infinity),
    maintainAspectRatio: Boolean = false,
    onResize: (SpatialResizeEvent) -> Unit = {},
): SubspaceModifier

When the resizable modifier is present and enabled, UI controls will be shown that allow the user to resize the element in 3D space. The final transform of the attached Composable will be set by the system. The resize affordance will not curve and thus adding it to a Composable with curvature like SpatialCurvedRow is not recommended.

Parameters

enabled Whether resizing is enabled for this object. If false, the object cannot be resized. Changing the enabled state of the modifier does not clear the user resize state; whereas, removing the modifier will reset the user resize state, causing the object to revert to its layout size.
minimumSize The minimum allowable size for the object, represented by a DpVolumeSize. The object cannot be scaled down beyond these dimensions. Defaults to DpVolumeSize.Zero.
maximumSize The maximum allowable size for the object, represented by a DpVolumeSize. The object cannot be scaled up beyond these dimensions. Defaults to a DpVolumeSize with all dimensions set to Dp.Infinity, meaning no upper limit by default.
maintainAspectRatio If true, the object's aspect ratio (proportions) will be preserved during resizing. If false, individual dimensions can be changed independently.
onResize Optional observer callback invoked during the manipulation to observe resize events through SpatialResizeEvent. Since the system automatically applies the resize, this callback is strictly for monitoring changes and does not control the size.

Last updated: