18

I use Glide. Here snippet:

Glide.with(context).load(referenceUrl).into(holder.imageViewPhoto);

OK. It's work fine. But I need image to show with radius corners only on TOP.

Something like this:

radius

Is it possible by Glide?

Zoe stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
Alex
  • 593
  • 1
  • 6
  • 18
  • 3
    Try this with some customizations : http://thedeveloperworldisyours.com/android/rounded-corners-with-glide/ – Vidhi Dave Nov 17 '17 at 12:49
  • Nice. It's work. One question: int sCorner = 10 - it's on dp or pixels? – Alex Nov 17 '17 at 13:06
  • Use [This link](https://stackoverflow.com/questions/24735214/android-how-to-programmatically-round-only-top-corners-of-a-bitmap) and create a Custom transformation for glide .. – ADM Nov 17 '17 at 13:16
  • @ADM, thanks! I got another [link](https://stackoverflow.com/questions/2459916/how-to-make-an-imageview-with-rounded-corners/5252726) there which helped me with rectangular images. – CoolMind Dec 15 '20 at 21:19

1 Answers1

24

You can use :

requestOptions.centerInside().transform(new CenterInside(), new GranularRoundedCorners(topLeft, topRight, bottomRight, bottomLeft))
Ranzz
  • 336
  • 2
  • 10