androidx.xr.compose.platform
Interfaces
SpatialCapabilities |
Provides information and functionality related to the spatial capabilities of the application. |
SpatialConfiguration |
Provides information and functionality related to the spatial configuration of the application. |
Extension functions summary
suspend Unit |
Request that the system places the application into full space mode. |
suspend Unit |
Request that the system places the application into home space mode. |
Top-level properties summary
ProvidableCompositionLocal<Session?> |
A composition local that provides the current Jetpack XR |
ProvidableCompositionLocal<SpatialCapabilities> |
Provides the current |
ProvidableCompositionLocal<SpatialConfiguration> |
Provides the current |
Extension functions
requestFullSpace
suspend fun ComponentActivity.requestFullSpace(): Unit
Request that the system places the application into full space mode.
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.
This suspend function will complete once the application has successfully entered full space. Cancelling this suspend function does not cancel the request to switch spaces. This should not throw any exceptions and will do nothing on devices that do not support XR spaces. This request will be cancelled if requestFullSpace or requestHomeSpace is called before this request completes.
See modes in XR.
requestHomeSpace
suspend fun ComponentActivity.requestHomeSpace(): Unit
Request that the system places the application into home space mode.
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.
This suspend function will complete once the application has successfully entered home space. Cancelling this suspend function does not cancel the request to switch spaces. This should not throw any exceptions and will do nothing on devices that do not support XR spaces. This request will be cancelled if requestHomeSpace or requestFullSpace is called before this request completes.
See modes in XR.
Top-level properties
LocalSession
val LocalSession: ProvidableCompositionLocal<Session?>
A composition local that provides the current Jetpack XR Session.
In non-XR environments, this composition local will return null.
LocalSpatialCapabilities
val LocalSpatialCapabilities: ProvidableCompositionLocal<SpatialCapabilities>
Provides the current SpatialCapabilities that are currently available to the application.
The SpatialCapabilities represents a set of inherent permissions that the application may have depending on the context. For example, in home space mode, the app may not have the ability to create spatial UI; however, in full space mode, the application may have this capability.
LocalSpatialConfiguration
val LocalSpatialConfiguration: ProvidableCompositionLocal<SpatialConfiguration>
Provides the current SpatialConfiguration.
The behavior of the configuration object will depend on whether the system XR Spatial feature is enabled. For example, if the feature is not enabled, attempting to request different mode types cause an exception.