Interface

SpatialConfiguration

Provides information and functionality related to the spatial configuration of the application.

Source set: Android
public sealed interface SpatialConfiguration

Provides information and functionality related to the spatial configuration of the application.

Properties

bounds

Source set: Android
public val bounds: DpVolumeSize

A volume whose width, height, and depth represent the space available to the application.

In XR, an application's available space is not related to the display or window dimensions; instead, it will always be some subset of the virtual 3D space. The app bounds will change when switching between home space or full space modes.

In non-XR environments, the width and height will represent the screen width and height available to the application (see android.content.res.Configuration.screenWidthDp and android.content.res.Configuration.screenHeightDp) and the depth will be zero.

This is a state-based value that will trigger recomposition.

hasXrSpatialFeature

Source set: Android
public val hasXrSpatialFeature: Boolean

XR Spatial APIs are supported for this system. This is equivalent to PackageManager.hasSystemFeature(FEATURE_XR_SPATIAL, version) where version is the minimum version for features available in the XR Compose library used.

Functions

requestHomeSpaceMode

public fun requestHomeSpaceMode()

Request that the system places the application into home space mode. This will execute asynchronously. If it completes successfully then bounds will change. This method will throw an UnsupportedOperationException if the application is not in an XR environment.

In home space, the visible space may be shared with other applications; however, applications in home space will have their spatial capabilities and physical bounds limited.

See modes in XR.

requestFullSpaceMode

public fun requestFullSpaceMode()

Request that the system places the application into full space mode. This will execute asynchronously. If it completes successfully then bounds will change. This method will throw an UnsupportedOperationException if the application is not in an XR environment.

In full space, this application will be the only application in the visible space, its spatial capabilities will be expanded, and its physical bounds will expand to fill the entire virtual space.

See modes in XR.

Last updated: