Open FynnJason opened 7 years ago
可以自己实现ImageEngine里的方法 ` public class GlideEngine implements ImageEngine {
@Override public void loadThumbnail(Context context, int resize, Drawable placeholder, ImageView imageView, Uri uri) { // 加载图片 Glide.with(context) .asBitmap() .load(uri) .apply(new RequestOptions().placeholder(placeholder).override(resize, resize).centerCrop()) .transition(new BitmapTransitionOptions().crossFade(300)) .into(imageView); } @Override public void loadGifThumbnail(Context context, int resize, Drawable placeholder, ImageView imageView, Uri uri) { Glide.with(context) .asBitmap() .load(uri) .apply(new RequestOptions().placeholder(placeholder).override(resize, resize).centerCrop()) .transition(new BitmapTransitionOptions().crossFade(300)) .into(imageView); } @Override public void loadImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) { Glide.with(context) .load(uri) .apply(new RequestOptions().priority(Priority.HIGH).override(resizeX, resizeY).centerCrop()) .transition(new DrawableTransitionOptions().crossFade(300)) .into(imageView); } @Override public void loadGifImage(Context context, int resizeX, int resizeY, ImageView imageView, Uri uri) { Glide.with(context) .asGif() .load(uri) .apply(new RequestOptions().priority(Priority.HIGH).override(resizeX, resizeY).centerCrop()) .into(imageView); } @Override public boolean supportAnimatedGif() { return true; }
}`
A PR has been sent developing this feature, see https://github.com/zhihu/Matisse/pull/114.
可以自己实现ImageEngine里的方法 ` public class GlideEngine implements ImageEngine {
}`