use of com.bumptech.glide.request.RequestListener in project CloudReader by youlookwhat.
the class TestActivity method setData.
private void setData() {
if (subjectsBean != null) {
// 高斯模糊背景
Glide.with(this).load(subjectsBean.getImages().getLarge()).error(R.drawable.stackblur_default).bitmapTransform(new BlurTransformation(this, 12, 5)).listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
mToolbar.setBackgroundColor(Color.TRANSPARENT);
binding.ivTitleBg.setImageAlpha(0);
binding.ivTitleBg.setVisibility(View.VISIBLE);
return false;
}
}).into(binding.ivTitleBg);
}
}
Aggregations