# MovableComponentTester

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/MovableComponentTester.kt+class:androidx.xr.scenecore.testing.MovableComponentTester) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
public final class MovableComponentTester
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#hashCode()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#isAnchorable()()` Whether this component is user-anchorable. |
| `final boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#isScaleInZ()()` Whether this component scales in Z. |
| `final boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#isSystemMovable()()` Whether this component is system-movable. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveEnd(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.Entity)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Ray finalInputRay, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose finalPose, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 finalScale, https://developer.android.com/reference/androidx/xr/scenecore/Entity updatedParent )` Simulates the end of a move event from the runtime, notifying all registered listeners. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveStart(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.Entity)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Ray initialInputRay, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose initialPose, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 initialScale, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity initialParent )` Simulates the start of a move event from the runtime, notifying all registered listeners. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveUpdate(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Ray currentInputRay, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose currentPose, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 currentScale )` Simulates an update to an ongoing move event from the runtime, notifying all registered listeners. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### hashCode

```
public int hashCode()
```

### isAnchorable

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

```
public final boolean isAnchorable()
```

Whether this component is user-anchorable.

This is set to `true` when created via `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#createAnchorable(androidx.xr.runtime.Session,kotlin.collections.Set,kotlin.Boolean)`, and `false` otherwise.

### isScaleInZ

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

```
public final boolean isScaleInZ()
```

Whether this component scales in Z.

This corresponds to the `scaleInZ` parameter used in `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#createCustomMovable(androidx.xr.runtime.Session,kotlin.Boolean,java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)` or `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#createSystemMovable(androidx.xr.runtime.Session,kotlin.Boolean)`. It is always `false` when created via `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#createAnchorable(androidx.xr.runtime.Session,kotlin.collections.Set,kotlin.Boolean)`.

### isSystemMovable

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

```
public final boolean isSystemMovable()
```

Whether this component is system-movable.

This is set to `true` when created via `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#createSystemMovable(androidx.xr.runtime.Session,kotlin.Boolean)` or `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#createAnchorable(androidx.xr.runtime.Session,kotlin.collections.Set,kotlin.Boolean)`, and `false` when created via `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#createCustomMovable(androidx.xr.runtime.Session,kotlin.Boolean,java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)`.

### triggerOnMoveEnd

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

```
public final void triggerOnMoveEnd(
    @NonNull Ray finalInputRay,
    @NonNull Pose finalPose,
    @NonNull Vector3 finalScale,
    Entity updatedParent
)
```

Simulates the end of a move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#addMoveListener(java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Ray finalInputRay` | The final ray origin and direction in activity space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose finalPose` | The final pose of the entity, relative to its parent. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 finalScale` | The final scale of the entity. |
| `https://developer.android.com/reference/androidx/xr/scenecore/Entity updatedParent` | The updated parent of the entity if it was changed during the move. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | If `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveStart(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.Entity)` has not been called. |

### triggerOnMoveStart

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

```
public final void triggerOnMoveStart(
    @NonNull Ray initialInputRay,
    @NonNull Pose initialPose,
    @NonNull Vector3 initialScale,
    @NonNull Entity initialParent
)
```

Simulates the start of a move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#addMoveListener(java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Ray initialInputRay` | The initial ray origin and direction in activity space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose initialPose` | The initial pose of the entity, relative to its parent. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 initialScale` | The initial scale of the entity. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity initialParent` | The parent of the entity at the start of the move. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | If a move is already in progress. |

### triggerOnMoveUpdate

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

```
public final void triggerOnMoveUpdate(
    @NonNull Ray currentInputRay,
    @NonNull Pose currentPose,
    @NonNull Vector3 currentScale
)
```

Simulates an update to an ongoing move event from the runtime, notifying all registered listeners.

This triggers callbacks registered via `https://developer.android.com/reference/androidx/xr/scenecore/MovableComponent#addMoveListener(java.util.concurrent.Executor,androidx.xr.scenecore.EntityMoveListener)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Ray currentInputRay` | The current ray origin and direction in activity space. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose currentPose` | The current pose of the entity, relative to its parent. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 currentScale` | The current scale of the entity. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | If `https://developer.android.com/reference/androidx/xr/scenecore/testing/MovableComponentTester#triggerOnMoveStart(androidx.xr.runtime.math.Ray,androidx.xr.runtime.math.Pose,androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.Entity)` has not been called. |