ActivitySpace
class ActivitySpace : SpaceEntity
| kotlin.Any | ||||
| ↳ | androidx.xr.scenecore.BaseScenePose | |||
| ↳ | androidx.xr.scenecore.Entity | |||
| ↳ | androidx.xr.scenecore.SpaceEntity | |||
| ↳ | androidx.xr.scenecore.ActivitySpace |
ActivitySpace is a SpaceEntity used to track the system-managed pose and boundary of the volume associated with a spatialized Activity. The Application cannot directly control this volume, but the system might update it in response to the User moving it or entering or exiting Full Space Mode.
Summary
Public functions |
|
|---|---|
Unit |
addBoundsChangedListener(listener: Consumer<FloatSize3d>)Adds the given |
Unit |
addBoundsChangedListener(Adds the given |
Unit |
addOriginChangedListener(listener: Runnable)Adds a listener to be called when the ActivitySpace's origin has moved or changed, typically due to an internal system event. |
Unit |
addOriginChangedListener(executor: Executor, listener: Runnable)Adds a listener to be called when the ActivitySpace's origin has moved or changed, typically due to an internal system event. |
Unit |
removeBoundsChangedListener(listener: Consumer<FloatSize3d>)Releases the given |
Unit |
removeOriginChangedListener(listener: Runnable)Removes the previously-added listener. |
Public properties |
|
|---|---|
FloatSize3d |
The current bounds of this ActivitySpace. |
BoundingBox |
A recommended box for content to be placed in when in Full Space. |
Inherited functions |
||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||
|
||||||||||||||||||||
|
Inherited properties |
||||
|---|---|---|---|---|
|
||||
|
Public functions
addBoundsChangedListener
fun addBoundsChangedListener(listener: Consumer<FloatSize3d>): Unit
Adds the given Consumer as a listener to be invoked when this ActivitySpace's current boundary changes.
Consumer.accept will be invoked on the main thread.
| Parameters | |
|---|---|
listener: Consumer<FloatSize3d> |
The Consumer to be invoked when this ActivitySpace's current boundary changes. |
addBoundsChangedListener
fun addBoundsChangedListener(
callbackExecutor: Executor,
listener: Consumer<FloatSize3d>
): Unit
Adds the given Consumer as a listener to be invoked when this ActivitySpace's current boundary changes.
Consumer.accept will be invoked on the given executor.
| Parameters | |
|---|---|
callbackExecutor: Executor |
The executor on which to invoke the listener on. |
listener: Consumer<FloatSize3d> |
The Consumer to be invoked when this ActivitySpace's current boundary changes. |
addOriginChangedListener
fun addOriginChangedListener(listener: Runnable): Unit
Adds a listener to be called when the ActivitySpace's origin has moved or changed, typically due to an internal system event.
When this event occurs, any ScenePose that is not a child of ActivitySpace, such as AnchorSpace, will have a different position relative to the ActivitySpace. Therefore, this listener can be used to indicate when to invalidate any cached information about the relative difference in Pose between ActivitySpace's children and children of non-ActivitySpace ScenePoses.
The callback will be made on the SceneCore executor.
| Parameters | |
|---|---|
listener: Runnable |
The listener to register. |
addOriginChangedListener
fun addOriginChangedListener(executor: Executor, listener: Runnable): Unit
Adds a listener to be called when the ActivitySpace's origin has moved or changed, typically due to an internal system event.
When this event occurs, any ScenePose that is not a child of ActivitySpace, such as AnchorSpace, will have a different position relative to the ActivitySpace. Therefore, this listener can be used to indicate when to invalidate any cached information about the relative difference in Pose between ActivitySpace's children and children of non-ActivitySpace ScenePoses.
removeBoundsChangedListener
fun removeBoundsChangedListener(listener: Consumer<FloatSize3d>): Unit
Releases the given Consumer from receiving updates when the ActivitySpace's boundary changes.
All listeners are automatically removed when the ActivitySpace is disposed even if this method is not explicitly called.
| Parameters | |
|---|---|
listener: Consumer<FloatSize3d> |
The Consumer to be removed from receiving updates. |
removeOriginChangedListener
fun removeOriginChangedListener(listener: Runnable): Unit
Removes the previously-added listener.
All listeners are automatically removed when the ActivitySpace is disposed even if this method is not explicitly called.
Public properties
recommendedContentBoxInFullSpace
val recommendedContentBoxInFullSpace: BoundingBox
A recommended box for content to be placed in when in Full Space.
The recommended content box is a static 3D volume that uses the device's field of view (FOV) angles, the system's default launch distance from the user, and the default scale of the system to calculate a box size that is sized to encompass the user's primary field of view.
This size does not change throughout the lifecycle of the application. Furthermore, the recommended content box does not have an independent concept of pose; its position is defined by the origin of this ActivitySpace.
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.