Glide 圆角

//加载圆形头像  Glide3.6
   /* Glide.with(getActivity()).load(bean.icon)
            .asBitmap().centerCrop().into(new BitmapImageViewTarget(mUser_icon) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(getActivity().getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            mUser_icon.setImageDrawable(circularBitmapDrawable);
        }
    });*/

 

 

Glide3.6
//圆角图片
implementation 'jp.wasabeef:glide-transformations:2.0.2'

Glide.with(getContext()).load(bean.icon)
        .bitmapTransform(new CropCircleTransformation(getContext()))
        .into(mUser_icon);

 

 

Glide 4.0

//头像
Glide.with(getContext()).load(info.publisher.avatarUrl).
        apply(RequestOptions.bitmapTransform(new CircleCrop())).into(holder.iv_headImage);

 

你可能感兴趣的:(Glide 圆角)