ResizePolicy

class ResizePolicy


Defines the resizing policy for a spatial object.

This class specifies how a spatial object can be resized, including enabling/disabling resizing, setting minimum and maximum size constraints, and controlling aspect ratio maintenance.

Summary

Public constructors

ResizePolicy(
    isEnabled: Boolean,
    minimumSize: DpVolumeSize,
    maximumSize: DpVolumeSize,
    shouldMaintainAspectRatio: Boolean,
    onResizeStart: ((IntVolumeSize) -> Unit)?,
    onResizeUpdate: ((IntVolumeSize) -> Unit)?,
    onResizeEnd: ((IntVolumeSize) -> Unit)?,
    onSizeChange: ((IntVolumeSize) -> Boolean)?
)

This function is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

Public functions

open operator Boolean
equals(other: Any?)

This function is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

open Int

This function is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

open String

This function is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

Public properties

Boolean

This property is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

DpVolumeSize

This property is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

DpVolumeSize

This property is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

((IntVolumeSize) -> Unit)?

This property is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

((IntVolumeSize) -> Unit)?

This property is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

((IntVolumeSize) -> Unit)?

This property is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

((IntVolumeSize) -> Boolean)?

This property is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

Boolean

This property is deprecated. Use SubspaceModifier.transformingResizable() or SubspaceModifier.resizable() instead.

Public constructors

ResizePolicy

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
ResizePolicy(
    isEnabled: Boolean = true,
    minimumSize: DpVolumeSize = DpVolumeSize.Zero,
    maximumSize: DpVolumeSize = DpVolumeSize(Dp.Infinity, Dp.Infinity, Dp.Infinity),
    shouldMaintainAspectRatio: Boolean = false,
    onResizeStart: ((IntVolumeSize) -> Unit)? = null,
    onResizeUpdate: ((IntVolumeSize) -> Unit)? = null,
    onResizeEnd: ((IntVolumeSize) -> Unit)? = null,
    onSizeChange: ((IntVolumeSize) -> Boolean)? = null
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

isEnabled

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
val isEnabledBoolean

Whether resizing is enabled for this object. If false, the object cannot be resized. Defaults to true.

maximumSize

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
val maximumSizeDpVolumeSize

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.

minimumSize

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
val minimumSizeDpVolumeSize

The minimum allowable size for the object, represented by a DpVolumeSize. The object cannot be scaled down beyond these dimensions. Defaults to DpVolumeSize.Zero.

onResizeEnd

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
val onResizeEnd: ((IntVolumeSize) -> Unit)?

A callback to be called with the new size when the resize event ends.

onResizeStart

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
val onResizeStart: ((IntVolumeSize) -> Unit)?

A callback to be called when the resize event starts.

onResizeUpdate

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
val onResizeUpdate: ((IntVolumeSize) -> Unit)?

A callback to be called when the size changes during a resize event.

onSizeChange

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
val onSizeChange: ((IntVolumeSize) -> Boolean)?

A callback to be called when the object's size changes, after a resize event has ended. It receives an IntVolumeSize representing the new size. Returning true from this callback indicates that the developer intends to handle the size change, and the API should not resize the object. Returning false indicates that the developer will not handle the size change, and the API should proceed with changing the size of the object itself. If the callback is null (the default), the API will change the size of the object.

shouldMaintainAspectRatio

Added in 1.0.0-alpha15
Deprecated in 1.0.0-alpha15
val shouldMaintainAspectRatioBoolean

If true, the object's aspect ratio (proportions) will be preserved during resizing. If false, individual dimensions can be changed independently. Defaults to false.