java.lang.Object | ||
↳ | android.graphics.drawable.Drawable | |
↳ | com.facebook.imagepipeline.animated.base.AbstractAnimatedDrawable |
![]() |
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)
.
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Returns whether a previous call to draw(Canvas)
would have rendered a frame.
draw(Canvas)
would have rendered a frame
Informs the Drawable to drop its caches.
Get the animation duration of 1 loop.
Get the number of frames for the animation.
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.
LOOP_COUNT_INFINITE
Sets an id that will be logged with any of the logging calls. Useful for debugging.
logId | the id to log |
---|
Throwable |
---|