I've tried to use the built in RoundedCornerTransformation but I also want to draw a border. Which is the best way to get it? As a temporary solution I've wrapped the imageview in a MaterialCardView.
Could I get better performances using a transformation?
Thank you very much!
Coil doesn't support setting a border with RoundedCornerTransformation out of the box. You'll have to write a custom Transformation to use support that.
In terms of performance, Transformations will be faster in some cases, but slower in others. For rounded corners it would be faster to clip the image when drawing the bitmap on a View's canvas. This is because adding a Transformation forces Coil to return a software bitmap instead of a hardware bitmap. Overall, I wouldn't worry about performance, though; both should be fast.
Thank you very much! I found out I can use a ShapeableImageView from Material Components to get the same result without wrapping an imageview into a card.
Most helpful comment
Thank you very much! I found out I can use a ShapeableImageView from Material Components to get the same result without wrapping an imageview into a card.