Android中Glide的使用
Glide3升级到Glide4碰到的问题
(1)into
在Glide3.x中:
Bitmap bitmap = Glide.with(BaseApplication.getAppContext())
.load(url).asBitmap()
.into(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
.get();
在Glide4.x中
Bitmap bitmap = Glide.with(BaseApplication.getAppContext()).asBitmap().load(url)
.apply(new RequestOptions().override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)).submit().get();
(2)bitmapTransform
在Glide3.x中:
Glide.with(XXXActivity.this).load("path").error(R.mipmap.zhan_error).bitmapTransform(new RoundedCornersTransformation(GeZiShowActivity.this, 13, 0,
RoundedCornersTransformation.CornerType.ALL)).into(imageView_show);
在Glide4.x中
RequestOptions myOptions = new RequestOptions().transform(new RoundedCornersTransformation(GeZiShowActivity.this,10,0,RoundedCornersTransformation.CornerType.ALL));
Glide.with(GeZiShowActivity.this).load("path").error(R.mipmap.zhan_error).apply(myOptions).into(imageView_show);