# TestSpatialAnnotation

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

*** ** * ** ***


```
@ExperimentalSpatialAnnotationsApi
public final class TestSpatialAnnotation extends TestTrackable
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.xr.arcore.testing.TestTrackable](https://developer.android.com/reference/androidx/xr/arcore/testing/TestTrackable) ||
|   | ↳ | [androidx.xr.arcore.testing.TestSpatialAnnotation](https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation) |

*** ** * ** ***

A simulated SpatialAnnotation in the test environment.

Modifying the properties on this instance will automatically trigger the underlying perception runtime to tick forward, allowing reactive UI tests to synchronously test spatial layout shifts.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#TestSpatialAnnotation(androidx.xr.arcore.SpatialAnnotationId)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/SpatialAnnotationId id)` |

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/androidx/xr/arcore/SpatialAnnotationQuadAlignment` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#getAlignment()()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/SpatialAnnotationId` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#getId()()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#getPose()()` |
| `final https://developer.android.com/reference/androidx/xr/runtime/math/Quad` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#getQuad()()` |
| `boolean` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#isVisible()()` indicates whether the trackable object is currently in view of the runtime |
| `final void` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#setAlignment(androidx.xr.arcore.SpatialAnnotationQuadAlignment)(https://developer.android.com/reference/androidx/xr/arcore/SpatialAnnotationQuadAlignment value)` |
| `final void` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#setPose(androidx.xr.runtime.math.Pose)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose value)` |
| `final void` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#setQuad(androidx.xr.runtime.math.Quad)(https://developer.android.com/reference/androidx/xr/runtime/math/Quad value)` |
| `void` | `https://developer.android.com/reference/androidx/xr/arcore/testing/TestSpatialAnnotation#setVisible(kotlin.Boolean)(boolean value)` indicates whether the trackable object is currently in view of the runtime |

## Public constructors

### TestSpatialAnnotation

Added in [1.1.0-alpha01](https://developer.android.com/jetpack/androidx/releases/xr-arcore#1.1.0-alpha01)

```
public TestSpatialAnnotation(@NonNull SpatialAnnotationId id)
```

## Public methods

### getAlignment

Added in [1.1.0-alpha01](https://developer.android.com/jetpack/androidx/releases/xr-arcore#1.1.0-alpha01)

```
public final SpatialAnnotationQuadAlignment getAlignment()
```

### getId

Added in [1.1.0-alpha01](https://developer.android.com/jetpack/androidx/releases/xr-arcore#1.1.0-alpha01)

```
public final @NonNull SpatialAnnotationId getId()
```

### getPose

Added in [1.1.0-alpha01](https://developer.android.com/jetpack/androidx/releases/xr-arcore#1.1.0-alpha01)

```
public final @NonNull Pose getPose()
```

### getQuad

Added in [1.1.0-alpha01](https://developer.android.com/jetpack/androidx/releases/xr-arcore#1.1.0-alpha01)

```
public final Quad getQuad()
```

### isVisible

```
public boolean isVisible()
```

indicates whether the trackable object is currently in view of the runtime

### setAlignment

Added in [1.1.0-alpha01](https://developer.android.com/jetpack/androidx/releases/xr-arcore#1.1.0-alpha01)

```
public final void setAlignment(SpatialAnnotationQuadAlignment value)
```

### setPose

Added in [1.1.0-alpha01](https://developer.android.com/jetpack/androidx/releases/xr-arcore#1.1.0-alpha01)

```
public final void setPose(@NonNull Pose value)
```

### setQuad

Added in [1.1.0-alpha01](https://developer.android.com/jetpack/androidx/releases/xr-arcore#1.1.0-alpha01)

```
public final void setQuad(Quad value)
```

### setVisible

```
public void setVisible(boolean value)
```

indicates whether the trackable object is currently in view of the runtime