androidx.xr.compose.unit

Classes

DpVolumeOffset

Represents the offset of an object in 3D space.

DpVolumeSize

Represents the size of a volume in density-independent pixels (Dp).

IntVolumeOffset

Represents the offset of an object in 3D space.

IntVolumeSize

Represents the size of a volume in pixels.

VolumeConstraints

Defines constraints for a 3D volume, specifying minimum and maximum values for width, height, and depth.

Annotations

ExperimentalSpatialVolumeOffsetApi

Marks the Spatial Volume Offset APIs as experimental.

Extension functions summary

VolumeConstraints

Constrains the dimensions of this VolumeConstraints object to fit within the bounds of the other VolumeConstraints object.

Int

Constrains a given depth value to fit within the bounds of this VolumeConstraints object.

Int

Constrains a given height value to fit within the bounds of this VolumeConstraints object.

Int

Constrains a given width value to fit within the bounds of this VolumeConstraints object.

VolumeConstraints
VolumeConstraints.offset(horizontal: Int, vertical: Int, depth: Int)

Creates a new VolumeConstraints object by offsetting the minimum and maximum values of this one.

Extension functions

VolumeConstraints.constrain

fun VolumeConstraints.constrain(otherConstraints: VolumeConstraints): VolumeConstraints

Constrains the dimensions of this VolumeConstraints object to fit within the bounds of the other VolumeConstraints object.

Parameters
otherConstraints: VolumeConstraints

the other VolumeConstraints to constrain against.

Returns
VolumeConstraints

a new VolumeConstraints object with dimensions constrained within the bounds of otherConstraints.

VolumeConstraints.constrainDepth

fun VolumeConstraints.constrainDepth(depth: Int): Int

Constrains a given depth value to fit within the bounds of this VolumeConstraints object.

Parameters
depth: Int

the depth value to constrain.

Returns
Int

the constrained depth value, ensuring it's within the minimum and maximum depth bounds.

VolumeConstraints.constrainHeight

fun VolumeConstraints.constrainHeight(height: Int): Int

Constrains a given height value to fit within the bounds of this VolumeConstraints object.

Parameters
height: Int

the height value to constrain.

Returns
Int

the constrained height value, ensuring it's within the minimum and maximum height bounds.

VolumeConstraints.constrainWidth

fun VolumeConstraints.constrainWidth(width: Int): Int

Constrains a given width value to fit within the bounds of this VolumeConstraints object.

Parameters
width: Int

the width value to constrain.

Returns
Int

the constrained width value, ensuring it's within the minimum and maximum width bounds.

VolumeConstraints.offset

fun VolumeConstraints.offset(horizontal: Int = 0, vertical: Int = 0, depth: Int = 0): VolumeConstraints

Creates a new VolumeConstraints object by offsetting the minimum and maximum values of this one.

Parameters
horizontal: Int = 0

the horizontal offset to apply.

vertical: Int = 0

the vertical offset to apply.

depth: Int = 0

the depth offset to apply.

Returns
VolumeConstraints

a new VolumeConstraints object with offset values.