Reputation: 522
I'm using this code to show profile image:
Glide.with(getContext()).load(url)
.dontAnimate()
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.circleCrop()
.into(my_profile_image);
But circleCrop() is cropping the image too much. So is there another way to round an image without too much cropping? I research it but I couldn't find another method.
Upvotes: 1
Views: 1772
Reputation: 21
Glide.with(getContext()).load(url)
.dontAnimate()
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(10))) // round
.into(my_profile_image);
Upvotes: 2
Reputation: 1464
How about this?
Glide.with(getContext()).load(url)
.dontAnimate()
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.apply(RequestOptions.circleCropTransform())
.into(my_profile_image);
Upvotes: 1