Mehmet Gür
Mehmet Gür

Reputation: 522

Glide - Round image without circle crop

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

Answers (2)

dea sic O
dea sic O

Reputation: 21

Glide.with(getContext()).load(url)
                            .dontAnimate()
                            .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
                             .apply(RequestOptions.bitmapTransform(new RoundedCorners(10))) // round
                            .into(my_profile_image);

Upvotes: 2

elbert rivas
elbert rivas

Reputation: 1464

How about this?

Glide.with(getContext()).load(url)
      .dontAnimate()
      .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
      .apply(RequestOptions.circleCropTransform())
      .into(my_profile_image);

Upvotes: 1

Related Questions