# EmbeddingAnimationParams.Builder

Artifact: [androidx.window:window](https://developer.android.com/jetpack/androidx/releases/window) [View Source](https://cs.android.com/search?q=file:androidx/window/embedding/EmbeddingAnimationParams.kt+class:androidx.window.embedding.EmbeddingAnimationParams.Builder) Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/window#1.4.0)

*** ** * ** ***


```
public final class EmbeddingAnimationParams.Builder
```

<br />

*** ** * ** ***

Builder for creating an instance of `https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams` | `https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder#build()()` Builds an `EmbeddingAnimationParams` instance with the attributes specified by the builder's setters. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder` | `@https://developer.android.com/reference/androidx/window/RequiresWindowSdkExtension(version = 5) https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder#setAnimationBackground(androidx.window.embedding.EmbeddingAnimationBackground)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationBackground background)` Sets the animation background. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder` | `@https://developer.android.com/reference/androidx/window/RequiresWindowSdkExtension(version = 7) https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder#setChangeAnimation(androidx.window.embedding.EmbeddingAnimationParams.AnimationSpec)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec spec)` Sets the change (resize or move) animation. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder` | `@https://developer.android.com/reference/androidx/window/RequiresWindowSdkExtension(version = 7) https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder#setCloseAnimation(androidx.window.embedding.EmbeddingAnimationParams.AnimationSpec)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec spec)` Sets the close animation. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder` | `@https://developer.android.com/reference/androidx/window/RequiresWindowSdkExtension(version = 7) https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder#setOpenAnimation(androidx.window.embedding.EmbeddingAnimationParams.AnimationSpec)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec spec)` Sets the open animation. |

## Public constructors

### Builder

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/window#1.4.0)

```
public Builder()
```

## Public methods

### build

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/window#1.4.0)

```
public final @NonNull EmbeddingAnimationParams build()
```

Builds an `EmbeddingAnimationParams` instance with the attributes specified by the builder's setters.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams` | the new `EmbeddingAnimationParams` instance. |

### setAnimationBackground

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/window#1.4.0)

```
@RequiresWindowSdkExtension(version = 5)
public final @NonNull EmbeddingAnimationParams.Builder setAnimationBackground(@NonNull EmbeddingAnimationBackground background)
```

Sets the animation background.

The default is to use the current theme window background color.

This can be supported only if the Window Extensions version of the target device is equals or higher than required API level. Otherwise, it would be no-op.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationBackground background` | the animation background. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder` | this `Builder`. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationBackground` |   |

### setChangeAnimation

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/window#1.5.0)

```
@RequiresWindowSdkExtension(version = 7)
public final @NonNull EmbeddingAnimationParams.Builder setChangeAnimation(@NonNull EmbeddingAnimationParams.AnimationSpec spec)
```

Sets the change (resize or move) animation.

The default is to use the system animation.

This can be supported only if the Window Extensions version of the target device is equals or higher than required API level. Otherwise, it would be no-op.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec spec` | the animation spec |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder` | this `Builder`. |

### setCloseAnimation

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/window#1.5.0)

```
@RequiresWindowSdkExtension(version = 7)
public final @NonNull EmbeddingAnimationParams.Builder setCloseAnimation(@NonNull EmbeddingAnimationParams.AnimationSpec spec)
```

Sets the close animation.

The default is to use the system animation.

This can be supported only if the Window Extensions version of the target device is equals or higher than required API level. Otherwise, it would be no-op.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec spec` | the animation transition spec |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder` | this `Builder`. |

### setOpenAnimation

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/window#1.5.0)

```
@RequiresWindowSdkExtension(version = 7)
public final @NonNull EmbeddingAnimationParams.Builder setOpenAnimation(@NonNull EmbeddingAnimationParams.AnimationSpec spec)
```

Sets the open animation.

The default is to use the system animation.

This can be supported only if the Window Extensions version of the target device is equals or higher than required API level. Otherwise, it would be no-op.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec spec` | the animation transition spec |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder` | this `Builder`. |