public class

AnimatedDrawable

extends AbstractAnimatedDrawable
implements AnimatableDrawable
java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ com.facebook.imagepipeline.animated.base.AbstractAnimatedDrawable
       ↳ com.facebook.imagepipeline.animated.base.AnimatedDrawable

Class Overview

A Drawable that renders a animated image. The details of the format are abstracted by the AnimatedDrawableBackend interface. The drawable can work either as an Animatable where the client calls start/stop to animate it or it can work as a level-based drawable where the client drives the animation by calling Drawable#setLevel.

Summary

Public Constructors
AnimatedDrawable(ScheduledExecutorService scheduledExecutorServiceForUiThread, AnimatedDrawableCachingBackend animatedDrawableBackend, AnimatedDrawableDiagnostics animatedDrawableDiagnostics, MonotonicClock monotonicClock)
Public Methods
ValueAnimator.AnimatorUpdateListener createAnimatorUpdateListener()
Creates an animator update listener that will animate the drawable directly.
ValueAnimator createValueAnimator()
An animator that will animate the drawable directly.
ValueAnimator createValueAnimator(int maxDurationMs)
An animator that will animate the drawable directly.
[Expand]
Inherited Methods
From class com.facebook.imagepipeline.animated.base.AbstractAnimatedDrawable
From class android.graphics.drawable.Drawable
From class java.lang.Object
From interface android.graphics.drawable.Animatable
From interface com.facebook.drawable.base.DrawableWithCaches
From interface com.facebook.imagepipeline.animated.base.AnimatableDrawable

Public Constructors

public AnimatedDrawable (ScheduledExecutorService scheduledExecutorServiceForUiThread, AnimatedDrawableCachingBackend animatedDrawableBackend, AnimatedDrawableDiagnostics animatedDrawableDiagnostics, MonotonicClock monotonicClock)

Public Methods

public ValueAnimator.AnimatorUpdateListener createAnimatorUpdateListener ()

Creates an animator update listener that will animate the drawable directly. This is useful when the drawable needs to be animated by an existing value animator.

Returns
  • a new update listener

public ValueAnimator createValueAnimator ()

An animator that will animate the drawable directly. The loop count and duration will be determined by metadata in the original image. Update listener is attached automatically.

Returns
  • a new animator

public ValueAnimator createValueAnimator (int maxDurationMs)

An animator that will animate the drawable directly. The loop count will be set based on the specified duration. Update listener is attached automatically.

Parameters
maxDurationMs maximum duration animate
Returns
  • a new animator