public interface

AnimatedDrawableCachingBackend

implements AnimatedDrawableBackend
com.facebook.imagepipeline.animated.base.AnimatedDrawableCachingBackend
Known Indirect Subclasses

Class Overview

A specialized version of AnimatedDrawableBackend that adds caching and prefetching.

Summary

Public Methods
abstract void appendDebugOptionString(StringBuilder sb)
Appends a string about the state of the backend that might be useful for debugging.
abstract AnimatedDrawableCachingBackend forNewBounds(Rect bounds)
Creates a new AnimatedDrawableBackend with the same parameters but with a new bounds.
abstract CloseableReference<Bitmap> getBitmapForFrame(int frameNumber)
Gets the bitmap for the specified frame number.
abstract CloseableReference<Bitmap> getPreviewBitmap()
Gets the bitmap for the preview frame.
[Expand]
Inherited Methods
From interface com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend

Public Methods

public abstract void appendDebugOptionString (StringBuilder sb)

Appends a string about the state of the backend that might be useful for debugging.

Parameters
sb the builder to append to

public abstract AnimatedDrawableCachingBackend forNewBounds (Rect bounds)

Creates a new AnimatedDrawableBackend with the same parameters but with a new bounds.

Parameters
bounds the bounds
Returns
  • an AnimatedDrawableBackend with the new bounds (this may be the same instance if the bounds don't require a new backend)

public abstract CloseableReference<Bitmap> getBitmapForFrame (int frameNumber)

Gets the bitmap for the specified frame number. The bitmap should be the size of the rendered image according to getRenderedWidth() and getRenderedHeight() and ready to be drawn in the Drawable's draw method.

Parameters
frameNumber the frame number (0-based)
Returns
  • a reference to the bitmap which must be released by the caller when done or null to indicate to the caller that the bitmap is not ready and it should try again later

public abstract CloseableReference<Bitmap> getPreviewBitmap ()

Gets the bitmap for the preview frame. This will only return non-null if the ImageDecodeOptions were configured to decode the preview frame.

Returns
  • a reference to the preview bitmap which must be released by the caller when done or null if there is no preview bitmap set