ImageSelector icon indicating copy to clipboard operation
ImageSelector copied to clipboard

在预览界面ImagePreviewFragment中为什么加载图片一定要转成Bitmap呢?

Open humanheima opened this issue 7 years ago • 0 comments

  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;

humanheima avatar Feb 08 '18 03:02 humanheima