优化直播间加载.9图改为由Glide管理Bitmap

This commit is contained in:
zlzw 2022-10-06 18:15:34 +08:00
parent f10316bf57
commit 340217e922

View File

@ -33,15 +33,13 @@ public class LoadDian9TuUtil {
} }
} }
Glide.with(context) Glide.with(context)
.asFile() .asBitmap()
.load(imgUrl) .load(imgUrl)
.into(new CustomTarget<File>() { .into(new CustomTarget<Bitmap>() {
@Override @Override
public void onResourceReady(@NonNull File resource, @Nullable Transition<? super File> transition) { public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
try { try {
FileInputStream is = new FileInputStream(resource); setNinePathImage(context, imageView, resource, position);
setNinePathImage(context, imageView, BitmapFactory.decodeStream(is), position);
is.close();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }