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)?
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Boolean

Whether resizing is enabled for this object.

DpVolumeSize

The maximum allowable size for the object, represented by a DpVolumeSize.

DpVolumeSize

The minimum allowable size for the object, represented by a DpVolumeSize.

((IntVolumeSize) -> Unit)?

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

((IntVolumeSize) -> Unit)?

A callback to be called when the resize event starts.

((IntVolumeSize) -> Unit)?

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

((IntVolumeSize) -> Boolean)?

A callback to be called when the object's size changes, after a resize event has ended.

Boolean

If true, the object's aspect ratio (proportions) will be preserved during resizing.

Public constructors

ResizePolicy

Added in 1.0.0-alpha08
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-alpha08
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-alpha08
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-alpha08
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-alpha08
val onResizeEnd: ((IntVolumeSize) -> Unit)?

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

onResizeStart

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

A callback to be called when the resize event starts.

onResizeUpdate

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

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

onSizeChange

Added in 1.0.0-alpha08
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-alpha08
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.