mr.boyfox mr.boyfox - 1 year ago 1066
Android Question

How do rounded image with Glide library?

So, anybody know how to display an image with rounded corners with Glide?
I am loading an image with Glide, but I don't know how to pass rounded params to this library.

I need display image like following example:

enter image description here

Answer Source

You can use RoundedBitmapDrawable for circular Images with Glide. No Custom ImageView is required.

 Glide.with(context).load(url).asBitmap().centerCrop().into(new BitmapImageViewTarget(imageView) {
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(context.getResources(), resource);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download