Source set: Android
public class SpatialBiasAlignment(
@param:FloatRange(-1.0, 1.0) public val horizontalBias: Float,
@param:FloatRange(-1.0, 1.0) public val verticalBias: Float,
@param:FloatRange(-1.0, 1.0) public val depthBias: Float,
) : SpatialAlignment
Positions content in 3D space using horizontal, vertical, and depth bias.
Bias refers to a normalized floating-point value, typically within the range of [-1.0f, 1.0f], that determines how a child's content is positioned along a specific axis relative to its parent's available space.
- A bias of 0.0f centers the content along that axis.
- A bias of -1.0f aligns the content to one extreme (e.g., start for horizontal, bottom for vertical, back for depth).
- A bias of 1.0f aligns the content to the opposite extreme (e.g., end for horizontal, top for vertical, front for depth).
- Values between -1.0f and 1.0f linearly interpolate the position between these extremes.
Parameters
| horizontalBias | Must be within the range of [-1, 1] with -1 being start and 1 being end. |
| verticalBias | Must be within the range of [-1, 1] with -1 being bottom and 1 being top. |
| depthBias | Must be within the range of [-1, 1] with -1 being back and 1 being front. |
Functions
copy
public fun copy(
horizontalBias: Float = this.horizontalBias,
verticalBias: Float = this.verticalBias,
depthBias: Float = this.depthBias,
): SpatialBiasAlignment