Search in sources :

Example 1 with GlideCircleTransform

use of com.base.util.helper.GlideCircleTransform in project T-MVP by north2016.

the class BindingUtils method loadRoundAndBgImg.

public static void loadRoundAndBgImg(ImageView v, String url, ImageView im_header) {
    v.setColorFilter(v.getContext().getResources().getColor(SpUtil.isNight() ? R.color.CoverColor : R.color.colorWhite), PorterDuff.Mode.MULTIPLY);
    Glide.with(v.getContext()).load(getFuckUrl(url)).diskCacheStrategy(DiskCacheStrategy.ALL).transform(new GlideCircleTransform(v.getContext())).error(R.mipmap.ic_launcher).into(v);
    im_header.setColorFilter(v.getContext().getResources().getColor(SpUtil.isNight() ? R.color.CoverColor : R.color.colorWhite), PorterDuff.Mode.MULTIPLY);
    Glide.with(v.getContext()).load(getFuckUrl(url)).diskCacheStrategy(DiskCacheStrategy.ALL).transform(new BlurTransformation(v.getContext(), 100)).crossFade().into(im_header);
}
Also used : GlideCircleTransform(com.base.util.helper.GlideCircleTransform) BlurTransformation(com.base.util.helper.BlurTransformation)

Example 2 with GlideCircleTransform

use of com.base.util.helper.GlideCircleTransform in project T-MVP by north2016.

the class BindingUtils method loadRoundImg.

@BindingAdapter({ "roundImageUrl" })
public static void loadRoundImg(ImageView v, String url) {
    v.setColorFilter(v.getContext().getResources().getColor(SpUtil.isNight() ? R.color.CoverColor : R.color.colorWhite), PorterDuff.Mode.MULTIPLY);
    Glide.with(v.getContext()).load(getFuckUrl(url)).diskCacheStrategy(DiskCacheStrategy.ALL).transform(new GlideCircleTransform(v.getContext())).error(R.mipmap.ic_launcher).into(v);
}
Also used : GlideCircleTransform(com.base.util.helper.GlideCircleTransform) BindingAdapter(android.databinding.BindingAdapter)

Aggregations

GlideCircleTransform (com.base.util.helper.GlideCircleTransform)2 BindingAdapter (android.databinding.BindingAdapter)1 BlurTransformation (com.base.util.helper.BlurTransformation)1