ImageSelector
ImageSelector copied to clipboard
在预览界面ImagePreviewFragment中为什么加载图片一定要转成Bitmap呢?
final View contentView = inflater.inflate(R.layout.fragment_preview, container, false);
final ImageView imageView = contentView.findViewById(R.id.image);
final PhotoViewAttacher mAttacher = new PhotoViewAttacher(imageView);
// TODO: 2018/2/8 0008 不明白为什么要这样写
Glide.with(this)
.asBitmap()
.load(new File(strUrl))
.into(new SimpleTarget<Bitmap>(480, 800) {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
imageView.setImageBitmap(resource);
mAttacher.update();
}
});
return contentView;