public class

AnimatedImageResultBuilder

extends Object
java.lang.Object
   ↳ com.facebook.imagepipeline.animated.base.AnimatedImageResultBuilder

Class Overview

Builder for AnimatedImageResult.

Summary

Public Methods
AnimatedImageResult build()
BitmapTransformation getBitmapTransformation()
Gets the transformation that is to be applied to the image, or null if none.
List<CloseableReference<Bitmap>> getDecodedFrames()
Gets the decoded frames.
int getFrameForPreview()
Gets the frame that should be used for the preview image.
AnimatedImage getImage()
Gets the image for the result.
CloseableReference<Bitmap> getPreviewBitmap()
Gets the preview bitmap.
AnimatedImageResultBuilder setBitmapTransformation(BitmapTransformation bitmapTransformation)
Sets the transformation that is to be applied to the image.
AnimatedImageResultBuilder setDecodedFrames(List<CloseableReference<Bitmap>> decodedFrames)
Sets the decoded frames.
AnimatedImageResultBuilder setFrameForPreview(int frameForPreview)
Sets the frame that should be used for the preview image.
AnimatedImageResultBuilder setPreviewBitmap(CloseableReference<Bitmap> previewBitmap)
Sets a preview bitmap.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public AnimatedImageResult build ()

Builds the AnimatedImageResult. The preview bitmap and the decoded frames are closed after build is called, so this should not be called more than once or those fields will be lost after the first call.

Returns
  • the result

public BitmapTransformation getBitmapTransformation ()

Gets the transformation that is to be applied to the image, or null if none.

Returns
  • the transformation that is to be applied to the image, or null if none

public List<CloseableReference<Bitmap>> getDecodedFrames ()

Gets the decoded frames. Only used if the ImageDecodeOptions were configured to decode all frames at decode time.

Returns
  • the references to the decoded frames or null if none was set. This returns references that must be released by the caller

public int getFrameForPreview ()

Gets the frame that should be used for the preview image. If the preview bitmap was fetched, this is the frame that it's for.

Returns
  • the frame that should be used for the preview image

public AnimatedImage getImage ()

Gets the image for the result.

Returns
  • the image

public CloseableReference<Bitmap> getPreviewBitmap ()

Gets the preview bitmap. This method returns a new reference. The caller must close it.

Returns
  • the reference to the preview bitmap or null if none was set. This returns a reference that must be released by the caller

public AnimatedImageResultBuilder setBitmapTransformation (BitmapTransformation bitmapTransformation)

Sets the transformation that is to be applied to the image.

Parameters
bitmapTransformation the transformation that is to be applied to the image

public AnimatedImageResultBuilder setDecodedFrames (List<CloseableReference<Bitmap>> decodedFrames)

Sets the decoded frames. Only used if the ImageDecodeOptions were configured to decode all frames at decode time.

Parameters
decodedFrames the decoded frames. The method clones the references.

public AnimatedImageResultBuilder setFrameForPreview (int frameForPreview)

Sets the frame that should be used for the preview image. If the preview bitmap was fetched, this is the frame that it's for.

Returns
  • the frame that should be used for the preview image

public AnimatedImageResultBuilder setPreviewBitmap (CloseableReference<Bitmap> previewBitmap)

Sets a preview bitmap.

Parameters
previewBitmap the preview. The method clones the reference.
Returns
  • this builder