androidx.xr.compose.unit
Classes
DpVolumeSize |
Represents the size of a volume in density-independent pixels ( |
IntVolumeOffset |
Represents the offset of an object in 3D space. |
IntVolumeSize |
Represents the size of a volume in pixels. |
Meter |
Represents a dimension value in meters within 3D space. |
VolumeConstraints |
Defines constraints for a 3D volume, specifying minimum and maximum values for width, height, and depth. |
Extension functions summary
VolumeConstraints |
VolumeConstraints.constrain(otherConstraints: VolumeConstraints)Constrains the dimensions of this |
Int |
VolumeConstraints.constrainDepth(depth: Int)Constrains a given depth value to fit within the bounds of this |
Int |
VolumeConstraints.constrainHeight(height: Int)Constrains a given height value to fit within the bounds of this |
Int |
VolumeConstraints.constrainWidth(width: Int)Constrains a given |
inline operator Meter |
|
inline operator Meter |
|
inline operator Meter |
|
VolumeConstraints |
Creates a new |
inline operator Meter |
|
inline operator Meter |
|
inline operator Meter |
|
inline Meter |
Extension functions
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 |
| Returns | |
|---|---|
VolumeConstraints |
a new |
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. |
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. |
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. |
offset
fun VolumeConstraints.offset(
horizontal: Int = 0,
vertical: Int = 0,
depth: Int = 0,
resetMins: Boolean = false
): 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. |
resetMins: Boolean = false |
if true, the minimum values in the new constraints will be set to 0, otherwise. they will be offset. |
| Returns | |
|---|---|
VolumeConstraints |
a new |
toMeter
inline fun Dp.toMeter(): Meter
Handles unspecified and infinite Dp values gracefully.
| Returns | |
|---|---|
Meter |
the equivalent value in meters, or |