androidx.xr.compose.subspace

Interfaces

SpatialBoxScope

Scope for the children of SpatialBox.

SpatialColumnScope

Scope for customizing the layout of children within a SpatialColumn.

SpatialRowScope

Scope for customizing the layout of children within a SpatialRow.

Objects

SpatialPanelDefaults

Contains default values used by spatial panels.

Annotations

SubspaceComposable

Marks a composable function or other code element as intended for use within the context of SubspaceComposable functions.

Top-level functions summary

Unit

Creates a SpatialPanel backed by the main Window content.

Unit
@Composable
@SubspaceComposable
SpatialBox(
    modifier: SubspaceModifier,
    alignment: SpatialAlignment,
    propagateMinConstraints: Boolean,
    name: String,
    content: @Composable @SubspaceComposable SpatialBoxScope.() -> Unit
)

A layout composable that sizes itself to fit its content, subject to incoming constraints.

Unit
@Composable
@SubspaceComposable
SpatialColumn(
    modifier: SubspaceModifier,
    alignment: SpatialAlignment,
    name: String,
    content: @Composable @SubspaceComposable SpatialColumnScope.() -> Unit
)

A layout composable that arranges its children in a vertical sequence.

Unit

A composable that represents an empty space layout.

Unit

A composable that represents an empty space layout.

Unit
@Composable
@SubspaceComposable
SpatialPanel(
    intent: Intent,
    modifier: SubspaceModifier,
    name: String,
    shape: SpatialShape
)

Creates a SpatialPanel and launches an Activity within it.

Unit
@Composable
@SubspaceComposable
SpatialPanel(
    modifier: SubspaceModifier,
    name: String,
    shape: SpatialShape,
    content: @Composable @UiComposable () -> Unit
)

Creates a SpatialPanel representing a 2D plane in 3D space in which an application can fill content.

Unit
@Composable
@SubspaceComposable
SpatialPanel(
    view: View,
    modifier: SubspaceModifier,
    name: String,
    shape: SpatialShape
)

Creates a SpatialPanel representing a 2D plane in 3D space in which an application can fill content.

Unit
@Composable
@SubspaceComposable
SpatialRow(
    modifier: SubspaceModifier,
    alignment: SpatialAlignment,
    curveRadius: Dp,
    name: String,
    content: @Composable @SubspaceComposable SpatialRowScope.() -> Unit
)

A layout composable that arranges its children in a horizontal sequence.

Unit
@Composable
@SubspaceComposable
Volume(
    modifier: SubspaceModifier,
    name: String,
    onVolumeEntity: (Entity) -> Unit
)

A composable that represents a 3D volume of space within which an application can fill content.

<Error class: unknown class>

Create a ComposeView that is applicable to the local context.

Top-level functions

@Composable
@SubspaceComposable
fun MainPanel(
    modifier: SubspaceModifier = SubspaceModifier,
    shape: SpatialShape = SpatialPanelDefaults.shape
): Unit

Creates a SpatialPanel backed by the main Window content.

This panel requires the following specific configuration in the Android Manifest for proper sizing/resizing behavior:

<activity
android
:configChanges="orientation|screenSize|screenLayout|smallestScreenSize>
<!--suppress AndroidElementNotAllowed -->
<layout android:defaultWidth="
50dp" android:defaultHeight="50dp" android:minHeight="50dp"
android:minWidth="
50dp"/>
</activity>
Parameters
modifier: SubspaceModifier = SubspaceModifier

SubspaceModifier to apply to the MainPanel.

shape: SpatialShape = SpatialPanelDefaults.shape

The shape of this Spatial Panel.

SpatialBox

@Composable
@SubspaceComposable
fun SpatialBox(
    modifier: SubspaceModifier = SubspaceModifier,
    alignment: SpatialAlignment = SpatialAlignment.Center,
    propagateMinConstraints: Boolean = false,
    name: String = defaultSpatialBoxName(),
    content: @Composable @SubspaceComposable SpatialBoxScope.() -> Unit
): Unit

A layout composable that sizes itself to fit its content, subject to incoming constraints.

A layout composable with content. The SpatialBox will size itself to fit the content, subject to the incoming constraints. When children are smaller than the parent, by default they will be positioned inside the SpatialBox according to the alignment. For individually specifying the alignments of the children layouts, use the SpatialBoxScope.align modifier. By default, the content will be measured without the SpatialBox's incoming min constraints. If propagateMinConstraints is set to true, the min size set on the SpatialBox will also be applied to the content.

Note: If the content has multiple children, they might overlap depending on their positioning.

Parameters
modifier: SubspaceModifier = SubspaceModifier

The modifier to be applied to the layout.

alignment: SpatialAlignment = SpatialAlignment.Center

The default alignment of children within the SpatialBox.

propagateMinConstraints: Boolean = false

Whether the incoming min constraints should be passed to content.

name: String = defaultSpatialBoxName()

The name for the SpatialBox.

content: @Composable @SubspaceComposable SpatialBoxScope.() -> Unit

The content of the SpatialBox.

SpatialColumn

@Composable
@SubspaceComposable
fun SpatialColumn(
    modifier: SubspaceModifier = SubspaceModifier,
    alignment: SpatialAlignment = SpatialAlignment.Center,
    name: String = defaultSpatialColumnName(),
    content: @Composable @SubspaceComposable SpatialColumnScope.() -> Unit
): Unit

A layout composable that arranges its children in a vertical sequence.

For arranging children horizontally, see SpatialRow.

Parameters
modifier: SubspaceModifier = SubspaceModifier

Modifiers to apply to the layout.

alignment: SpatialAlignment = SpatialAlignment.Center

The default alignment for child elements within the column.

name: String = defaultSpatialColumnName()

The name of the layout.

content: @Composable @SubspaceComposable SpatialColumnScope.() -> Unit

The composable content to be laid out vertically.

SpatialLayoutSpacer

@Composable
@SubspaceComposable
fun SpatialLayoutSpacer(modifier: SubspaceModifier = SubspaceModifier): Unit

A composable that represents an empty space layout. Its size can be controlled using modifiers like SubspaceModifier.width, SubspaceModifier.height, etc.

Parameters
modifier: SubspaceModifier = SubspaceModifier

Modifiers to apply to the spacer.

SpatialLayoutSpacer

@Composable
@SubspaceComposable
fun SpatialLayoutSpacer(
    modifier: SubspaceModifier = SubspaceModifier,
    name: String = defaultSpatialLayoutSpacerName()
): Unit

A composable that represents an empty space layout. Its size can be controlled using modifiers like SubspaceModifier.width, SubspaceModifier.height, etc.

Parameters
modifier: SubspaceModifier = SubspaceModifier

Modifiers to apply to this spacer.

name: String = defaultSpatialLayoutSpacerName()

The name of this SpatialLayoutSpacer element.

SpatialPanel

@Composable
@SubspaceComposable
fun SpatialPanel(
    intent: Intent,
    modifier: SubspaceModifier = SubspaceModifier,
    name: String = "ActivityPanel-",
    shape: SpatialShape = SpatialPanelDefaults.shape
): Unit

Creates a SpatialPanel and launches an Activity within it.

Parameters
intent: Intent

The intent of an Activity to launch within this panel.

modifier: SubspaceModifier = SubspaceModifier

SubspaceModifiers to apply to the SpatialPanel.

name: String = "ActivityPanel-"

A name for the SpatialPanel, useful for debugging.

shape: SpatialShape = SpatialPanelDefaults.shape

The shape of this Spatial Panel.

SpatialPanel

@Composable
@SubspaceComposable
fun SpatialPanel(
    modifier: SubspaceModifier = SubspaceModifier,
    name: String = defaultSpatialPanelName(),
    shape: SpatialShape = SpatialPanelDefaults.shape,
    content: @Composable @UiComposable () -> Unit
): Unit

Creates a SpatialPanel representing a 2D plane in 3D space in which an application can fill content.

Parameters
modifier: SubspaceModifier = SubspaceModifier

SubspaceModifiers to apply to the SpatialPanel.

name: String = defaultSpatialPanelName()

A name for the SpatialPanel, useful for debugging.

shape: SpatialShape = SpatialPanelDefaults.shape

The shape of this Spatial Panel.

content: @Composable @UiComposable () -> Unit

The composable content to render within the SpatialPanel.

SpatialPanel

@Composable
@SubspaceComposable
fun SpatialPanel(
    view: View,
    modifier: SubspaceModifier = SubspaceModifier,
    name: String = defaultSpatialPanelName(),
    shape: SpatialShape = SpatialPanelDefaults.shape
): Unit

Creates a SpatialPanel representing a 2D plane in 3D space in which an application can fill content.

Parameters
view: View

Content view to be displayed within the SpatialPanel.

modifier: SubspaceModifier = SubspaceModifier

SubspaceModifiers to apply to the SpatialPanel.

name: String = defaultSpatialPanelName()

A name for the SpatialPanel, useful for debugging.

shape: SpatialShape = SpatialPanelDefaults.shape

The shape of this Spatial Panel.

@Composable
@SubspaceComposable
fun SpatialRow(
    modifier: SubspaceModifier = SubspaceModifier,
    alignment: SpatialAlignment = SpatialAlignment.Center,
    curveRadius: Dp = Dp.Infinity,
    name: String = defaultSpatialRowName(),
    content: @Composable @SubspaceComposable SpatialRowScope.() -> Unit
): Unit

A layout composable that arranges its children in a horizontal sequence. For arranging children vertically, see SpatialColumn.

Parameters
modifier: SubspaceModifier = SubspaceModifier

Appearance modifiers to apply to this Composable.

alignment: SpatialAlignment = SpatialAlignment.Center

The default alignment for child elements within the row.

curveRadius: Dp = Dp.Infinity

The radial distance (in Dp) of the polar coordinate system of this row. It is a positive value. Setting this value to Dp.Infinity or a non-positive value will flatten the row. When a row is curved, its elements will be oriented so that they lie tangent to the curved row. A typical curved row has a curve radius of 825.dp.

name: String = defaultSpatialRowName()

A string name to associated with the SpatialRow. This can be useful identifying the SpatialRow when debugging spatial applications.

content: @Composable @SubspaceComposable SpatialRowScope.() -> Unit

The composable content to be laid out horizontally in the row.

@Composable
@SubspaceComposable
fun Volume(
    modifier: SubspaceModifier = SubspaceModifier,
    name: String = defaultVolumeName(),
    onVolumeEntity: (Entity) -> Unit
): Unit

A composable that represents a 3D volume of space within which an application can fill content.

This composable provides a Entity through the onVolumeEntity lambda, allowing the caller to attach child Jetpack XR Entities to it.

Parameters
modifier: SubspaceModifier = SubspaceModifier

SubspaceModifiers to apply to the Volume.

name: String = defaultVolumeName()

A name associated with this Volume entity, useful for debugging.

onVolumeEntity: (Entity) -> Unit

A lambda function that will be invoked when the Entity becomes available.

rememberComposeView

@Composable
fun rememberComposeView(content: @Composable () -> Unit): <Error class: unknown class>

Create a ComposeView that is applicable to the local context.

This handles propagating the composition context and ensures that savable state is remembered.