Search in sources :

Example 1 with AnimatedDrawableCachingBackendWrapper

use of com.facebook.fresco.animation.wrapper.AnimatedDrawableCachingBackendWrapper in project fresco by facebook.

the class ExperimentalAnimationFactory method createAnimationBackend.

private AnimationBackend createAnimationBackend(AnimatedImageResult animatedImageResult) {
    // Create the animated drawable backend
    AnimatedImage animatedImage = animatedImageResult.getImage();
    Rect initialBounds = new Rect(0, 0, animatedImage.getWidth(), animatedImage.getHeight());
    AnimatedDrawableBackend animatedDrawableBackend = mAnimatedDrawableBackendProvider.get(animatedImageResult, initialBounds);
    // Add caching backend
    AnimatedDrawableCachingBackend animatedDrawableCachingBackend = mAnimatedDrawableCachingBackendProvider.get(animatedDrawableBackend, AnimatedDrawableOptions.DEFAULTS);
    AnimatedDrawableCachingBackendWrapper animatedDrawableCachingBackendWrapper = new AnimatedDrawableCachingBackendWrapper(animatedDrawableCachingBackend);
    // Add inactivity check
    return AnimationBackendDelegateWithInactivityCheck.createForBackend(animatedDrawableCachingBackendWrapper, mMonotonicClock, mScheduledExecutorServiceForUiThread);
}
Also used : AnimatedDrawableBackend(com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend) Rect(android.graphics.Rect) AnimatedImage(com.facebook.imagepipeline.animated.base.AnimatedImage) CloseableAnimatedImage(com.facebook.imagepipeline.image.CloseableAnimatedImage) AnimatedDrawableCachingBackend(com.facebook.imagepipeline.animated.base.AnimatedDrawableCachingBackend) AnimatedDrawableCachingBackendWrapper(com.facebook.fresco.animation.wrapper.AnimatedDrawableCachingBackendWrapper)

Aggregations

Rect (android.graphics.Rect)1 AnimatedDrawableCachingBackendWrapper (com.facebook.fresco.animation.wrapper.AnimatedDrawableCachingBackendWrapper)1 AnimatedDrawableBackend (com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend)1 AnimatedDrawableCachingBackend (com.facebook.imagepipeline.animated.base.AnimatedDrawableCachingBackend)1 AnimatedImage (com.facebook.imagepipeline.animated.base.AnimatedImage)1 CloseableAnimatedImage (com.facebook.imagepipeline.image.CloseableAnimatedImage)1