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

A callback function invoked when the object's size changes.

Boolean

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

Public constructors

ResizePolicy

Added in 1.0.0-alpha07
ResizePolicy(
    isEnabled: Boolean = true,
    minimumSize: DpVolumeSize = DpVolumeSize.Zero,
    maximumSize: DpVolumeSize = DpVolumeSize(Dp.Infinity, Dp.Infinity, Dp.Infinity),
    shouldMaintainAspectRatio: Boolean = false,
    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-alpha07
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-alpha07
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-alpha07
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.

onSizeChange

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

A callback function invoked when the object's size changes. It receives an IntVolumeSize representing the new size and should return true to accept the size change, or false to reject it. Defaults to null.

shouldMaintainAspectRatio

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