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
- A bias of 1.0f aligns the content to the opposite extreme (e.g., end for horizontal, top for
- Values between -1.0f and 1.0f linearly interpolate the position between these extremes.
vertical, back for depth).
vertical, front for depth).
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
align
Source set: Android
override fun align(
size: IntVolumeSize,
space: IntVolumeSize,
layoutDirection: LayoutDirection,
): Vector3
copy
Source set: Android
public fun copy(
horizontalBias: Float = this.horizontalBias,
verticalBias: Float = this.verticalBias,
depthBias: Float = this.depthBias,
): SpatialBiasAlignment
equals
Source set: Android
override fun equals(other: Any?): Boolean
hashCode
Source set: Android
override fun hashCode(): Int
toString
Source set: Android
override fun toString(): String
Members
Horizontal
Source set: Android
public class Horizontal(@param:FloatRange(-1.0, 1.0) public val horizontalBias: Float) :
SpatialAlignment.Horizontal
Creates a weighted alignment that specifies a horizontal bias.
Parameters
| horizontalBias | Must be within the range of [-1, 1] with -1 being start and 1 being end. |
Functions
align
Source set: Android
override fun align(size: Int, space: Int, layoutDirection: LayoutDirection): Int
equals
Source set: Android
override fun equals(other: Any?): Boolean
hashCode
Source set: Android
override fun hashCode(): Int
toString
Source set: Android
override fun toString(): String
copy
Source set: Android
public fun copy(bias: Float = this.horizontalBias): Horizontal
Vertical
Source set: Android
public class Vertical(@param:FloatRange(-1.0, 1.0) public val verticalBias: Float) :
SpatialAlignment.Vertical
Creates a weighted alignment that specifies a vertical bias.
Parameters
| verticalBias | Must be within the range of [-1, 1] with -1 being bottom and 1 being top. |
Functions
align
Source set: Android
override fun align(size: Int, space: Int): Int
equals
Source set: Android
override fun equals(other: Any?): Boolean
hashCode
Source set: Android
override fun hashCode(): Int
toString
Source set: Android
override fun toString(): String
copy
Source set: Android
public fun copy(bias: Float = this.verticalBias): Vertical
Depth
Source set: Android
public class Depth(@param:FloatRange(-1.0, 1.0) public val depthBias: Float) :
SpatialAlignment.Depth
Creates a weighted alignment that specifies a depth bias.
Parameters
| depthBias | Must be within the range of [-1, 1] with -1 being back and 1 being front. |
Functions
align
Source set: Android
override fun align(size: Int, space: Int): Int
equals
Source set: Android
override fun equals(other: Any?): Boolean
hashCode
Source set: Android
override fun hashCode(): Int
toString
Source set: Android
override fun toString(): String
copy
Source set: Android
public fun copy(bias: Float = this.depthBias): Depth
Companion
Source set: Android
public companion object