# EmbeddingAnimationParams.Builder

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/window/embedding/EmbeddingAnimationParams.Builder "View this page in Java")

<br />

```
class EmbeddingAnimationParams.Builder
```

<br />

*** ** * ** ***

Builder for creating an instance of[EmbeddingAnimationParams](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams).

## Summary

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

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

## Public constructors

### Builder

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

```
Builder()
```  

## Public functions

### build

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

```
fun build(): EmbeddingAnimationParams
```

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

|                                                            Returns                                                            |
|-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| [EmbeddingAnimationParams](https://developer.android.com/reference/kotlin/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)
fun setAnimationBackground(background: EmbeddingAnimationBackground): EmbeddingAnimationParams.Builder
```

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                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
| `background: `[EmbeddingAnimationBackground](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationBackground) | the animation background. |

|                                                                    Returns                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| [EmbeddingAnimationParams.Builder](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams.Builder) | this`Builder`. |

|                                                               See also                                                                |
|---------------------------------------------------------------------------------------------------------------------------------------|---|
| [EmbeddingAnimationBackground](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationBackground) |   |

### setChangeAnimation

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

```
@RequiresWindowSdkExtension(version = 7)
fun setChangeAnimation(spec: EmbeddingAnimationParams.AnimationSpec): EmbeddingAnimationParams.Builder
```

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                                                                             |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| `spec: `[EmbeddingAnimationParams.AnimationSpec](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec) | the animation spec |

|                                                                    Returns                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| [EmbeddingAnimationParams.Builder](https://developer.android.com/reference/kotlin/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)
fun setCloseAnimation(spec: EmbeddingAnimationParams.AnimationSpec): EmbeddingAnimationParams.Builder
```

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                                                                             |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
| `spec: `[EmbeddingAnimationParams.AnimationSpec](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec) | the animation transition spec |

|                                                                    Returns                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| [EmbeddingAnimationParams.Builder](https://developer.android.com/reference/kotlin/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)
fun setOpenAnimation(spec: EmbeddingAnimationParams.AnimationSpec): EmbeddingAnimationParams.Builder
```

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                                                                             |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
| `spec: `[EmbeddingAnimationParams.AnimationSpec](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams.AnimationSpec) | the animation transition spec |

|                                                                    Returns                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| [EmbeddingAnimationParams.Builder](https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingAnimationParams.Builder) | this`Builder`. |