use of com.facebook.imagepipeline.animated.base.AnimatedDrawable in project boxing by Bilibili.
the class BoxingFrescoLoader method createDrawableFromFetchedResult.
private Drawable createDrawableFromFetchedResult(Context context, CloseableImage image) {
if (image instanceof CloseableStaticBitmap) {
CloseableStaticBitmap closeableStaticBitmap = (CloseableStaticBitmap) image;
BitmapDrawable bitmapDrawable = createBitmapDrawable(context, closeableStaticBitmap.getUnderlyingBitmap());
return (closeableStaticBitmap.getRotationAngle() != 0 && closeableStaticBitmap.getRotationAngle() != -1 ? new OrientedDrawable(bitmapDrawable, closeableStaticBitmap.getRotationAngle()) : bitmapDrawable);
} else if (image instanceof CloseableAnimatedImage) {
AnimatedDrawableFactory animatedDrawableFactory = Fresco.getImagePipelineFactory().getAnimatedFactory().getAnimatedDrawableFactory(context);
if (animatedDrawableFactory != null) {
AnimatedDrawable animatedDrawable = (AnimatedDrawable) animatedDrawableFactory.create(image);
if (animatedDrawable != null) {
return animatedDrawable;
}
}
}
throw new UnsupportedOperationException("Unrecognized image class: " + image);
}
use of com.facebook.imagepipeline.animated.base.AnimatedDrawable in project fresco by facebook.
the class AnimatedDrawableFactoryImpl method createAnimatedDrawable.
private AnimatedDrawable createAnimatedDrawable(AnimatedDrawableOptions options, AnimatedDrawableBackend animatedDrawableBackend) {
DisplayMetrics displayMetrics = mResources.getDisplayMetrics();
AnimatedDrawableDiagnostics animatedDrawableDiagnostics;
AnimatedDrawableCachingBackend animatedDrawableCachingBackend = mAnimatedDrawableCachingBackendProvider.get(animatedDrawableBackend, options);
if (options.enableDebugging) {
animatedDrawableDiagnostics = new AnimatedDrawableDiagnosticsImpl(mAnimatedDrawableUtil, displayMetrics);
} else {
animatedDrawableDiagnostics = AnimatedDrawableDiagnosticsNoop.getInstance();
}
return new AnimatedDrawable(mScheduledExecutorServiceForUiThread, animatedDrawableCachingBackend, animatedDrawableDiagnostics, mMonotonicClock);
}
Aggregations