public class

ExperimentalBitmapAnimationDrawableFactory

extends Object
implements DrawableFactory
java.lang.Object
   ↳ com.facebook.fresco.animation.factory.ExperimentalBitmapAnimationDrawableFactory

Class Overview

Animation factory for AnimatedDrawable2.

Summary

Nested Classes
class ExperimentalBitmapAnimationDrawableFactory.AnimationFrameCacheKey  
Constants
int CACHING_STRATEGY_FRESCO_CACHE
int CACHING_STRATEGY_FRESCO_CACHE_NO_REUSING
int CACHING_STRATEGY_KEEP_LAST_CACHE
int CACHING_STRATEGY_NO_CACHE
Public Constructors
ExperimentalBitmapAnimationDrawableFactory(AnimatedDrawableBackendProvider animatedDrawableBackendProvider, ScheduledExecutorService scheduledExecutorServiceForUiThread, ExecutorService executorServiceForFramePreparing, MonotonicClock monotonicClock, PlatformBitmapFactory platformBitmapFactory, CountingMemoryCache<CacheKeyCloseableImage> backingCache, Supplier<Integer> cachingStrategySupplier, Supplier<Integer> numberOfFramesToPrepareSupplier)
Public Methods
AnimatedDrawable2 createDrawable(CloseableImage image)
Create a drawable for the given image.
boolean supportsImageType(CloseableImage image)
Returns true if the factory can create a Drawable for the given image.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.imagepipeline.drawable.DrawableFactory

Constants

public static final int CACHING_STRATEGY_FRESCO_CACHE

Constant Value: 1 (0x00000001)

public static final int CACHING_STRATEGY_FRESCO_CACHE_NO_REUSING

Constant Value: 2 (0x00000002)

public static final int CACHING_STRATEGY_KEEP_LAST_CACHE

Constant Value: 3 (0x00000003)

public static final int CACHING_STRATEGY_NO_CACHE

Constant Value: 0 (0x00000000)

Public Constructors

public ExperimentalBitmapAnimationDrawableFactory (AnimatedDrawableBackendProvider animatedDrawableBackendProvider, ScheduledExecutorService scheduledExecutorServiceForUiThread, ExecutorService executorServiceForFramePreparing, MonotonicClock monotonicClock, PlatformBitmapFactory platformBitmapFactory, CountingMemoryCache<CacheKeyCloseableImage> backingCache, Supplier<Integer> cachingStrategySupplier, Supplier<Integer> numberOfFramesToPrepareSupplier)

Public Methods

public AnimatedDrawable2 createDrawable (CloseableImage image)

Create a drawable for the given image. It is guaranteed that this method is only called if supportsImageType(CloseableImage) returned true.

Parameters
image the image to create the drawable for
Returns
  • the Drawable for the image or null if an error occurred

public boolean supportsImageType (CloseableImage image)

Returns true if the factory can create a Drawable for the given image.

Parameters
image the image to check
Returns
  • true if a Drawable can be created