use of com.bumptech.glide.GenericRequestBuilder in project BBS-Android by bdpqchen.
the class GlideImageGeter method getDrawable.
@Override
public Drawable getDrawable(String url) {
final UrlDrawable urlDrawable = new UrlDrawable(mContext);
final GenericRequestBuilder load;
final Target target;
load = Glide.with(mContext).load(url).asBitmap().fitCenter().listener(new RequestListener<String, Bitmap>() {
@Override
public boolean onException(Exception e, String model, Target<Bitmap> target, boolean isFirstResource) {
LogUtil.dd("glide laod onException");
return false;
}
@Override
public boolean onResourceReady(Bitmap resource, String model, Target<Bitmap> target, boolean isFromMemoryCache, boolean isFirstResource) {
LogUtil.dd("glide load onResourceReady");
return false;
}
});
target = new BitmapTarget(urlDrawable);
// load.override(100, 100).into(target);
load.override(600, 600);
load.into(target);
return urlDrawable;
}
Aggregations