public final class SceneTester


A test utility for accessing and inspecting the data associated with the androidx.xr.scenecore.Scene.

Summary

Public methods

boolean
equals(Object other)
final @NonNull PanelClippingConfig

The current clipping configuration of all panels in the Scene.

final @NonNull Set<@NonNull SpatialCapability>

Simulates the spatial capabilities of the Session.

int
final void

Simulates the spatial capabilities of the Session.

final void

Simulates a runtime spatial mode change by dispatching the provided SpaceChangeEvent to the Scene.

final void

Invoking this function simulates a runtime visibility change.

Public methods

equals

public boolean equals(Object other)

getPanelClippingConfig

Added in 1.0.0-alpha16
public final @NonNull PanelClippingConfig getPanelClippingConfig()

The current clipping configuration of all panels in the Scene.

This property reflects the result of setting the Scene.panelClippingConfig value.

getSpatialCapabilities

Added in 1.0.0-alpha16
public final @NonNull Set<@NonNull SpatialCapabilitygetSpatialCapabilities()

Simulates the spatial capabilities of the Session.

This property's value changes in response to calls to Scene.requestFullSpaceMode and Scene.requestHomeSpaceMode. Any listeners registered via Scene.addSpatialCapabilitiesChangedListener are triggered upon a change in this value.

hashCode

public int hashCode()

setSpatialCapabilities

Added in 1.0.0-alpha16
public final void setSpatialCapabilities(@NonNull Set<@NonNull SpatialCapability> value)

Simulates the spatial capabilities of the Session.

This property's value changes in response to calls to Scene.requestFullSpaceMode and Scene.requestHomeSpaceMode. Any listeners registered via Scene.addSpatialCapabilitiesChangedListener are triggered upon a change in this value.

triggerSpaceChanged

Added in 1.0.0-alpha16
public final void triggerSpaceChanged(@NonNull SpaceChangeEvent spaceChangeEvent)

Simulates a runtime spatial mode change by dispatching the provided SpaceChangeEvent to the Scene.

This will trigger the custom listener registered via Scene.setSpaceChangedListener. If no custom listener is registered, or if it has been cleared via Scene.clearSpaceChangedListener, this invokes the default internal listener which automatically applies the recommended pose and scale from the event to the Scene.keyEntity.

Note: The listener is executed asynchronously on the java.util.concurrent.Executor configured for the listener (defaults to the main thread).

Parameters
@NonNull SpaceChangeEvent spaceChangeEvent

The simulated SpaceChangeEvent containing the recommended pose and scale to dispatch.

triggerSpatialVisibilityChanged

Added in 1.0.0-alpha16
public final void triggerSpatialVisibilityChanged(
    @NonNull SpatialVisibility spatialVisibility
)

Invoking this function simulates a runtime visibility change. This is useful for testing how the application handles transitions between different visibility states (e.g., releasing resources when HIDDEN).

Invoking this function will trigger any listeners registered via Scene.addSpatialVisibilityChangedListener.