SpatialConfiguration
sealed interface SpatialConfiguration
Provides information and functionality related to the spatial configuration of the application.
Summary
Public companion functions |
|
|---|---|
Boolean |
hasXrSpatialFeature(context: Context)XR Spatial APIs are supported for this system. |
Public properties |
|
|---|---|
DpVolumeSize |
A volume whose width, height, and depth represent the space available to the application. |
Boolean |
XR Spatial APIs are supported for this system. |
Public companion functions
hasXrSpatialFeature
fun hasXrSpatialFeature(context: Context): Boolean
XR Spatial APIs are supported for this system. This is equivalent to PackageManager.hasSystemFeature(FEATURE_XR_API_SPATIAL). When this feature is available, it is safe to assume we are in an XR environment.
| Parameters | |
|---|---|
context: Context |
The application or activity context used to check for the system feature. |
Public properties
bounds
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
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.