public abstract class SubspacePlaceable
A SubspacePlaceable corresponds to a child layout that can be positioned by its parent layout. Most SubspacePlaceable are the result of a SubspaceMeasurable.measure call.
Based on androidx.compose.ui.layout.Placeable.
Properties
width
public var width: Int = 0
The width, in pixels, of the measured layout, as seen by the parent. This will usually coincide with the measured width of the layout (aka the width value passed into SubspaceMeasureScope.layout), but can be different if the layout does not respect its incoming constraints: in these cases the width will be coerced inside the min and max width constraints - to access the actual width that the layout measured itself to, use measuredWidth.
height
public var height: Int = 0
The height, in pixels, of the measured layout, as seen by the parent. This will usually coincide with the measured height of the layout (aka the height value passed into SubspaceMeasureScope.layout), but can be different if the layout does not respect its incoming constraints: in these cases the height will be coerced inside the min and max height constraints - to access the actual height that the layout measured itself to, use measuredHeight.
depth
public var depth: Int = 0
The depth, in pixels, of the measured layout, as seen by the parent. This will usually coincide with the measured depth of the layout (aka the depth value passed into SubspaceMeasureScope.layout), but can be different if the layout does not respect its incoming constraints: in these cases the depth will be coerced inside the min and max depth constraints - to access the actual depth that the layout measured itself to, use measuredDepth.
measuredWidth
public var measuredWidth: Int = 0
The measured width of the layout. This might not respect measurementConstraints.
measuredHeight
public var measuredHeight: Int = 0
The measured height of the layout. This might not respect measurementConstraints.
measuredDepth
public var measuredDepth: Int = 0
The measured depth of the layout. This might not respect measurementConstraints.
Members
SubspacePlacementScope
public abstract class SubspacePlacementScope
Receiver scope that permits explicit placement of a SubspacePlaceable.
Properties
coordinates
public open val coordinates: SubspaceLayoutCoordinates?
The SubspaceLayoutCoordinates of this layout, if known or null if the layout hasn't been placed yet.
Functions
place
public fun SubspacePlaceable.place(pose: Pose)
Place a SubspacePlaceable at the Pose in its parent's coordinate system.
Parameters
| pose | The pose of the layout. |
placeRelative
public fun SubspacePlaceable.placeRelative(pose: Pose)
Place a SubspacePlaceable at the Pose in its parent's coordinate system with auto mirrored position along YZ plane if parent layout direction is LayoutDirection.Rtl.
If the parentLayoutDirection is LayoutDirection.Rtl, this function calculates a new pose by mirroring the original pose across the YZ plane. This ensures that layouts designed for LTR behave intuitively when the locale is switched to RTL.
The mirroring transformation involves:
- Translation: The
xcomponent of the translation vector is negated (x -> -x). This - Rotation: The
yandzcomponents of the underlying quaternion are negated. This
moves the object from the right side to the left side, or vice versa.
has the effect of reversing the direction of yaw (rotation around the Y-axis) and roll (rotation around the Z-axis), while leaving pitch (rotation around the X-axis) unchanged.
For example, a pose that places an object 20 dp to the left and yawed 30 degrees to the right will be transformed to place the object 20 dp to the right and yawed 30 degrees to the left.
If the layout direction is LTR, the original pose is used without modification.
This API is not mirroring the internal mesh geometry of 3D models. This function only affects pose of the layout.
Parameters
| pose | The pose of the layout. |