Glide

Transformation<Bitmap> circleCrop = new CircleCrop();
if (data.imgUrl.endsWith("gif")) {
Glide.with(context)
.asGif()
.diskCacheStrategy(DiskCacheStrategy.NONE)
.load(data.imgUrl)
.into(imageView);
} else if (data.imgUrl.endsWith("webp")) {
Glide.with(context)
.load(data.imgUrl)
.optionalTransform(circleCrop)
.optionalTransform(WebpDrawable.class, new WebpDrawableTransformation(circleCrop))
.into(imageView);
} else {
Glide.with(context)
.load(data.imgUrl)
.into(imageView);
}
打赏