Added in API level 23

Animatable2


interface Animatable2 : Animatable
AnimatedImageDrawable

Drawable for drawing animated images (like GIF).

AnimatedVectorDrawable

This class animates properties of a android.graphics.drawable.VectorDrawable with animations defined using android.animation.ObjectAnimator or android.animation.AnimatorSet.

Abstract class that drawables supporting animations and callbacks should extend.

Summary

Nested classes
abstract

Public methods
abstract Unit

Removes all existing animation callbacks.

abstract Unit

Adds a callback to listen to the animation events.

abstract Boolean

Removes the specified animation callback.

Inherited functions
Boolean isRunning()

Indicates whether the animation is running.

Unit start()

Starts the drawable's animation.

Unit stop()

Stops the drawable's animation.

Public methods

clearAnimationCallbacks

Added in API level 23
abstract fun clearAnimationCallbacks(): Unit

Removes all existing animation callbacks.

registerAnimationCallback

Added in API level 23
abstract fun registerAnimationCallback(callback: Animatable2.AnimationCallback): Unit

Adds a callback to listen to the animation events.

Parameters
callback Animatable2.AnimationCallback: Callback to add. This value cannot be null.

unregisterAnimationCallback

Added in API level 23
abstract fun unregisterAnimationCallback(callback: Animatable2.AnimationCallback): Boolean

Removes the specified animation callback.

Parameters
callback Animatable2.AnimationCallback: Callback to remove. This value cannot be null.
Return
Boolean false if callback didn't exist in the call back list, or true if callback has been removed successfully.