优化直播间加载.9图改为由Glide管理Bitmap
This commit is contained in:
parent
f10316bf57
commit
340217e922
@ -33,15 +33,13 @@ public class LoadDian9TuUtil {
|
||||
}
|
||||
}
|
||||
Glide.with(context)
|
||||
.asFile()
|
||||
.asBitmap()
|
||||
.load(imgUrl)
|
||||
.into(new CustomTarget<File>() {
|
||||
.into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull File resource, @Nullable Transition<? super File> transition) {
|
||||
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||
try {
|
||||
FileInputStream is = new FileInputStream(resource);
|
||||
setNinePathImage(context, imageView, BitmapFactory.decodeStream(is), position);
|
||||
is.close();
|
||||
setNinePathImage(context, imageView, resource, position);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user