Search in sources :

Example 6 with AnimatedImage

use of com.facebook.imagepipeline.animated.base.AnimatedImage in project fresco by facebook.

the class AnimatedDrawableFactoryImplSupport method create.

/**
   * Creates an {@link AnimatedDrawable} based on an {@link AnimatedImage}.
   *
   * @param animatedImageResult the result of the code
   * @param options additional options
   * @return a newly constructed {@link AnimatedDrawable}
   */
private AnimatedDrawableSupport create(AnimatedImageResult animatedImageResult, AnimatedDrawableOptions options) {
    AnimatedImage animatedImage = animatedImageResult.getImage();
    Rect initialBounds = new Rect(0, 0, animatedImage.getWidth(), animatedImage.getHeight());
    AnimatedDrawableBackend animatedDrawableBackend = mAnimatedDrawableBackendProvider.get(animatedImageResult, initialBounds);
    return createAnimatedDrawable(options, animatedDrawableBackend);
}
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)

Aggregations

AnimatedImage (com.facebook.imagepipeline.animated.base.AnimatedImage)6 CloseableAnimatedImage (com.facebook.imagepipeline.image.CloseableAnimatedImage)6 Rect (android.graphics.Rect)4 AnimatedDrawableBackend (com.facebook.imagepipeline.animated.base.AnimatedDrawableBackend)3 PooledByteBuffer (com.facebook.common.memory.PooledByteBuffer)2 AnimatedDrawableCachingBackendWrapper (com.facebook.fresco.animation.wrapper.AnimatedDrawableCachingBackendWrapper)1 AnimatedDrawableCachingBackend (com.facebook.imagepipeline.animated.base.AnimatedDrawableCachingBackend)1