# DynamicAnimation.OnAnimationEndListener

# DynamicAnimation.OnAnimationEndListener

Artifact:[androidx.dynamicanimation:dynamicanimation](https://developer.android.com/jetpack/androidx/releases/dynamicanimation)  
[View Source](https://cs.android.com/search?q=file:androidx/dynamicanimation/animation/DynamicAnimation.java+class:androidx.dynamicanimation.animation.DynamicAnimation.OnAnimationEndListener)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/dynamicanimation#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/dynamicanimation/animation/DynamicAnimation.OnAnimationEndListener "View this page in Java")

<br />

```
interface DynamicAnimation.OnAnimationEndListener
```

<br />

*** ** * ** ***

An animation listener that receives end notifications from an animation.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAnimationEnd](https://developer.android.com/reference/kotlin/androidx/dynamicanimation/animation/DynamicAnimation.OnAnimationEndListener#onAnimationEnd(androidx.dynamicanimation.animation.DynamicAnimation,boolean,float,float))`(` ` animation: `[DynamicAnimation](https://developer.android.com/reference/kotlin/androidx/dynamicanimation/animation/DynamicAnimation)`!,` ` canceled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` velocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` Notifies the end of an animation. |

## Public functions

### onAnimationEnd

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

```
fun onAnimationEnd(
    animation: DynamicAnimation!,
    canceled: Boolean,
    value: Float,
    velocity: Float
): Unit
```

Notifies the end of an animation. Note that this callback will be invoked not only when an animation reach equilibrium, but also when the animation is canceled.  

|                                                               Parameters                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
| `animation: `[DynamicAnimation](https://developer.android.com/reference/kotlin/androidx/dynamicanimation/animation/DynamicAnimation)`!` | animation that has ended or was canceled      |
| `canceled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                         | whether the animation has been canceled       |
| `value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                                                | the final value when the animation stopped    |
| `velocity: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                                             | the final velocity when the animation stopped |