public sealed class OrbiterPosition private constructor(
internal val alignment: SpatialAlignment,
internal val horizontalEdgeAlignment: EdgeAlignment,
internal val verticalEdgeAlignment: EdgeAlignment,
internal val offset: DpVolumeOffset,
)
Represents the position of an Orbiter in relation to the parent, defined by its alignment, edge alignment, and offset. The edge alignment can be configured for both vertical bounds (i.e., the top or bottom edges of a panel) and horizontal bounds (i.e., the start or end sides of the panel) depending on the specified alignment.
TopStart horizontalEdgeAlignment = EdgeAlignment.Outside and verticalEdgeAlignment = EdgeAlignment.Outside, Left-to-Right (LTR):
+---------+
| Orbiter |
+---------+------------------------+
| |
| |
| SpatialPanel |
| |
| |
+------------------------+
TopStart horizontalEdgeAlignment = EdgeAlignment.Outside, verticalEdgeAlignment = EdgeAlignment.Inside, Left-to-Right (LTR):
+---------+------------------------+
| Orbiter | |
+---------+ |
| SpatialPanel |
| |
| |
+------------------------+
TopStart horizontalEdgeAlignment = EdgeAlignment.Inside, verticalEdgeAlignment = EdgeAlignment.Outside, Left-to-Right (LTR):
+---------+
| Orbiter |
+---------+--------------+
| |
| SpatialPanel |
| |
| |
+------------------------+
TopStart horizontalEdgeAlignment = EdgeAlignment.Inside and verticalEdgeAlignment = EdgeAlignment.Inside, Left-to-Right (LTR):
+---------+--------------+
| Orbiter | |
+---------+ |
| SpatialPanel |
| |
| |
+------------------------+
TopStart horizontalEdgeAlignment = EdgeAlignment.Center and verticalEdgeAlignment = EdgeAlignment.Center, Left-to-Right (LTR):
+---------+
| Orbiter |------------------+
+---------+ |
| |
| SpatialPanel |
| |
| |
+------------------------+
BottomCenter verticalEdgeAlignment = EdgeAlignment.Center:
+------------------------+
| |
| |
| SpatialPanel |
| |
| +---------+ |
+------| Orbiter |-------+
+---------+
Members
Center
public class Center(
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation)
) :
OrbiterPosition(
alignment = SpatialAlignment.Center,
horizontalEdgeAlignment = EdgeAlignment.Center,
verticalEdgeAlignment = EdgeAlignment.Center,
offset = offset,
)
Center of the parent (non-edge).
Parameters
| offset | manual offset applied to the orbiter. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
TopStart
public class TopStart(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAlignment.TopStart,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Top-Start edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the start edge of the parent's bounds |
| verticalEdgeAlignment | boundary offset behavior relative to the top edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the edge offset is applied. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
TopCenter
public class TopCenter(
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAlignment.TopCenter,
horizontalEdgeAlignment = EdgeAlignment.Center,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Top-Center edge alignment.
Parameters
| verticalEdgeAlignment | boundary offset behavior relative to the top edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the verticalEdgeAlignment's offset is applied. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
TopEnd
public class TopEnd(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAlignment.TopEnd,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Top-End edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the end edge of the parent's bounds |
| verticalEdgeAlignment | boundary offset behavior relative to the top edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the edge offset is applied. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
CenterStart
public class CenterStart(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAlignment.CenterStart,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = EdgeAlignment.Center,
offset = offset,
)
Center-Start edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the start edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the horizontalEdgeAlignment's offset is applied. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
CenterEnd
public class CenterEnd(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAlignment.CenterEnd,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = EdgeAlignment.Center,
offset = offset,
)
Center-End edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the end edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the horizontalEdgeAlignment's offset is applied. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
BottomStart
public class BottomStart(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAlignment.BottomStart,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Bottom-Start edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the start edge of the parent's bounds |
| verticalEdgeAlignment | boundary offset behavior relative to the bottom edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the edge offset is applied. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
BottomCenter
public class BottomCenter(
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAlignment.BottomCenter,
horizontalEdgeAlignment = EdgeAlignment.Center,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Bottom-Center edge alignment.
Parameters
| verticalEdgeAlignment | boundary offset behavior relative to the bottom edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the verticalEdgeAlignment's offset is applied. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
BottomEnd
public class BottomEnd(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAlignment.BottomEnd,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Bottom-End edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the end edge of the parent's bounds |
| verticalEdgeAlignment | boundary offset behavior relative to the bottom edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the edge offset is applied. This offset will automatically adjust the horizontal offset according to the layout direction: when the layout direction is LTR, positive x offsets will move the content to the right and when the layout direction is RTL, positive x offsets will move the content to the left. |
TopLeft
public class TopLeft(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAbsoluteAlignment.TopLeft,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Top-Left absolute edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the left edge of the parent's bounds |
| verticalEdgeAlignment | boundary offset behavior relative to the top edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the edge offset is applied without considering layout direction |
TopRight
public class TopRight(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAbsoluteAlignment.TopRight,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Top-Right absolute edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the right edge of the parent's bounds |
| verticalEdgeAlignment | boundary offset behavior relative to the top edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the edge offset is applied without considering layout direction |
CenterLeft
public class CenterLeft(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAbsoluteAlignment.CenterLeft,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = EdgeAlignment.Center,
offset = offset,
)
Center-Left absolute edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the left edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the horizontalEdgeAlignment's offset is applied without considering layout direction |
CenterRight
public class CenterRight(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAbsoluteAlignment.CenterRight,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = EdgeAlignment.Center,
offset = offset,
)
Center-Right absolute edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the right edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the horizontalEdgeAlignment's offset is applied without considering layout direction |
BottomLeft
public class BottomLeft(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAbsoluteAlignment.BottomLeft,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Bottom-Left absolute edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the left edge of the parent's bounds |
| verticalEdgeAlignment | boundary offset behavior relative to the bottom edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the edge offset is applied without considering layout direction |
BottomRight
public class BottomRight(
horizontalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
verticalEdgeAlignment: EdgeAlignment = EdgeAlignment.Outside,
offset: DpVolumeOffset = DpVolumeOffset(0.dp, 0.dp, OrbiterDefaults.Elevation),
) :
OrbiterPosition(
alignment = SpatialAbsoluteAlignment.BottomRight,
horizontalEdgeAlignment = horizontalEdgeAlignment,
verticalEdgeAlignment = verticalEdgeAlignment,
offset = offset,
)
Bottom-Right absolute edge alignment.
Parameters
| horizontalEdgeAlignment | boundary offset behavior relative to the right edge of the parent's bounds |
| verticalEdgeAlignment | boundary offset behavior relative to the bottom edge of the parent's bounds |
| offset | manual offset applied to the orbiter after the edge offset is applied without considering layout direction |
EdgeAlignment
public class EdgeAlignment private constructor(private val value: Int)
Specifies how the Orbiter is aligned relative to its parent's layout boundary.
Note: Calculates alignment based on the parent's rectangular layout bounds, not its visual shape or rounded corners. Use a custom offset in DpVolumeOffset to align with curved or non-rectangular contours.
Members
Companion
public companion object
Properties
Outside
public val Outside: EdgeAlignment = EdgeAlignment(0)
Positions the Orbiter fully outside the parent's layout boundary.
The orbiter does not overlap the parent panel's layout bounds. For example, a side rail will sit completely to the side of the parent.
+------------------------+
| |
+---------+ |
| Orbiter | SpatialPanel |
+---------+ |
| |
+------------------------+
Inside
public val Inside: EdgeAlignment = EdgeAlignment(1)
Positions the Orbiter fully inside the parent's layout boundary.
The orbiter completely overlaps the parent panel's layout bounds, functioning as an overlay.
+------------------------+
| SpatialPanel |
+-----------+ |
| Orbiter | |
+-----------+ |
| |
+------------------------+
Center
public val Center: EdgeAlignment = EdgeAlignment(2)
Centers the Orbiter directly on the parent's layout boundary line.
The boundary line bisects the orbiter, placing it half-inside and half-outside the parent.
+------------------------+
| |
+-----|-----+ |
| Orbiter | SpatialPanel |
+-----|-----+ |
| |
+------------------------+