ActivitySpaceTester


class ActivitySpaceTester


A test-only data accessor for ActivitySpace that enables direct manipulation and inspection of its internal state.

Summary

Public functions

Unit

Sets the ActivitySpace bounds, invoking all registered listeners with the new bounds.

Unit

Simulates a change to the underlying space's origin.

Public properties

HitTestResult?

The HitTestResult to be returned by subsequent calls to ActivitySpace.hitTest.

BoundingBox

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

Public functions

triggerOnBoundsChanged

Added in 1.0.0-alpha16
fun triggerOnBoundsChanged(bounds: FloatSize3d): Unit

Sets the ActivitySpace bounds, invoking all registered listeners with the new bounds.

Parameters
bounds: FloatSize3d

The new bounds to propagate to the listeners.

triggerOnOriginChanged

Added in 1.0.0-alpha16
fun triggerOnOriginChanged(): Unit

Simulates a change to the underlying space's origin.

This function manually triggers any listeners registered via ActivitySpace.addOriginChangedListener, allowing tests to verify that the application correctly responds to spatial updates from the system.

Public properties

hitTestResult

Added in 1.0.0-alpha16
var hitTestResultHitTestResult?

The HitTestResult to be returned by subsequent calls to ActivitySpace.hitTest.

This property is typically used for testing or simulation purposes, allowing you to define the outcome of hit tests performed within the 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-alpha16
var recommendedContentBoxInFullSpaceBoundingBox

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

The box is relative to the ActivitySpace's coordinate system. It is not scaled by the 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.