# ActivitySpaceTester

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

*** ** * ** ***


```
class ActivitySpaceTester
```

<br />

*** ** * ** ***

A test-only data accessor for `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ActivitySpace` that enables direct manipulation and inspection of its internal state.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/ActivitySpaceTester#triggerOnBoundsChanged(androidx.xr.runtime.math.FloatSize3d)(bounds: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/FloatSize3d)` Sets the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ActivitySpace` bounds, invoking all registered listeners with the new bounds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/ActivitySpaceTester#triggerOnOriginChanged()()` Simulates a change to the underlying space's origin. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/HitTestResult?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/ActivitySpaceTester#hitTestResult()` The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/HitTestResult` to be returned by subsequent calls to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/BaseScenePose#hitTest(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Int)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/BoundingBox` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/ActivitySpaceTester#recommendedContentBoxInFullSpace()` The recommended box for content to be placed in when in Full Space Mode. |

## Public functions

### triggerOnBoundsChanged

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

```
fun triggerOnBoundsChanged(bounds: FloatSize3d): Unit
```

Sets the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ActivitySpace` bounds, invoking all registered listeners with the new bounds.

| Parameters |
|---|---|
| `bounds: https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/FloatSize3d` | The new bounds to propagate to the listeners. |

### triggerOnOriginChanged

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

```
fun triggerOnOriginChanged(): Unit
```

Simulates a change to the underlying space's origin.

This function manually triggers any listeners registered via `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ActivitySpace#addOriginChangedListener(java.util.concurrent.Executor,java.lang.Runnable)`, allowing tests to verify that the application correctly responds to spatial updates from the system.

## Public properties

### hitTestResult

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

```
var hitTestResult: HitTestResult?
```

The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/HitTestResult` to be returned by subsequent calls to `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/BaseScenePose#hitTest(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Int)`.

This property is typically used for testing or simulation purposes, allowing you to define the outcome of hit tests performed within the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ActivitySpace`.

Setting a non-null value describes the location and normal of the closest object hit, relative to the origin of the hit test ray. Set to `null` to simulate the hit test not intersecting with any objects.

### recommendedContentBoxInFullSpace

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

```
var recommendedContentBoxInFullSpace: BoundingBox
```

The recommended box for content to be placed in when in Full Space Mode.

The box is relative to the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ActivitySpace`'s coordinate system. It is not scaled by the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ActivitySpace`'s transform. The dimensions are always in meters. This provides a device-specific default volume that developers can use to size their content appropriately.