public abstract class

AbstractAnimatedDrawable

extends Drawable
implements Animatable DrawableWithCaches
java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ com.facebook.imagepipeline.animated.base.AbstractAnimatedDrawable
Known Direct Subclasses

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 setLevel(int).

Summary

Public Constructors
AbstractAnimatedDrawable(ScheduledExecutorService scheduledExecutorServiceForUiThread, AnimatedDrawableCachingBackend animatedDrawableBackend, AnimatedDrawableDiagnostics animatedDrawableDiagnostics, MonotonicClock monotonicClock)
Public Methods
boolean didLastDrawRender()
Returns whether a previous call to draw(Canvas) would have rendered a frame.
void draw(Canvas canvas)
void dropCaches()
Informs the Drawable to drop its caches.
int getDuration()
Get the animation duration of 1 loop.
int getFrameCount()
Get the number of frames for the animation.
int getIntrinsicHeight()
int getIntrinsicWidth()
int getLoopCount()
Get the loop count of the animation.
int getOpacity()
boolean isRunning()
void pause()
void setAlpha(int alpha)
void setColorFilter(ColorFilter cf)
void setLogId(String logId)
Sets an id that will be logged with any of the logging calls.
void start()
void stop()
Protected Methods
void finalize()
AnimatedDrawableCachingBackend getAnimatedDrawableBackend()
void onBoundsChange(Rect bounds)
boolean onLevelChange(int level)
[Expand]
Inherited Methods
From class android.graphics.drawable.Drawable
From class java.lang.Object
From interface android.graphics.drawable.Animatable
From interface com.facebook.drawable.base.DrawableWithCaches

Public Constructors

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

Public Methods

public boolean didLastDrawRender ()

Returns whether a previous call to draw(Canvas) would have rendered a frame.

Returns
  • whether a previous call to draw(Canvas) would have rendered a frame

public void draw (Canvas canvas)

public void dropCaches ()

Informs the Drawable to drop its caches.

public int getDuration ()

Get the animation duration of 1 loop.

Returns
  • the animation duration in ms

public int getFrameCount ()

Get the number of frames for the animation.

Returns
  • the number of frames of the animation

public int getIntrinsicHeight ()

public int getIntrinsicWidth ()

public int getLoopCount ()

Get the loop count of the animation. The returned value is either LOOP_COUNT_INFINITE if the animation is repeated infinitely or a positive integer that corresponds to the number of loops.

Returns

public int getOpacity ()

public boolean isRunning ()

public void pause ()

public void setAlpha (int alpha)

public void setColorFilter (ColorFilter cf)

public void setLogId (String logId)

Sets an id that will be logged with any of the logging calls. Useful for debugging.

Parameters
logId the id to log

public void start ()

public void stop ()

Protected Methods

protected void finalize ()

Throws
Throwable

protected AnimatedDrawableCachingBackend getAnimatedDrawableBackend ()

protected void onBoundsChange (Rect bounds)

protected boolean onLevelChange (int level)