# SpatialConfiguration

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/platform/SpatialConfiguration.kt+class:androidx.xr.compose.platform.SpatialConfiguration) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)


```
sealed interface SpatialConfiguration
```

<br />

*** ** * ** ***

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

## Summary

| ### Public companion functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/platform/SpatialConfiguration#hasXrSpatialFeature(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` XR Spatial APIs are supported for this system. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/unit/DpVolumeSize` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/platform/SpatialConfiguration#bounds()` A volume whose width, height, and depth represent the space available to the application. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/platform/SpatialConfiguration#hasXrSpatialFeature()` XR Spatial APIs are supported for this system. |

## Public companion functions

### hasXrSpatialFeature

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
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: https://developer.android.com/reference/android/content/Context.html` | The application or activity context used to check for the system feature. |

## Public properties

### bounds

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
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 `https://developer.android.com/reference/android/content/res/Configuration.html#screenWidthDp` and `https://developer.android.com/reference/android/content/res/Configuration.html#screenHeightDp`) and the depth will be zero.

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

### hasXrSpatialFeature

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
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.