I'm trying to achieve the below card view arc shape on the card view border/stroke. Already tried to search on google but didn't find any relevant answer that suits with requirements.
Any lead or help will be appreciated.
I'm trying to achieve the below card view arc shape on the card view border/stroke. Already tried to search on google but didn't find any relevant answer that suits with requirements.
Any lead or help will be appreciated.
On
You probably need to draw that arc in a custom composable, I found this article that can help you to understand the process of drawing in compose!
On
turtorial article: https://github.com/JeckOnly/passage/blob/master/Android/Widget/Compose/%E9%A1%B6%E9%83%A8%E5%87%B9%E9%99%B7Shape.md
code:https://gist.github.com/JeckOnly/54936415d1670103a4d400f66c8b31a1
hope this can help you though it is in Chinese language.
Answer from Cirilo Bido and Raghunandan is good place to start, you round corners of rectangle with
arcTobut you can't draw curved edges on top of clipped out shape. You need to usecubicToto draw rounded edge and curve to clip out bottom shapeYou can check out this answer for drawing with cubic to. By combining both you can draw that path.
Jetpack Compose: How to draw a path / line like this
I created this path based on article shared by
Raghunandan initially, even though that is amazing answer for animating BottomBar it doesn't create a rounded shape if you look closely, at the bottom it's creating a triangular shape at the bottom instead of rounded one and shape OP requires and in article is also different.
So i used sliders to create bezier from the link i shared above. It's available as tutorial here too. Still it can be tweaked to more precise shape if you wish to.
I used x0, y0 as reference point to set control points and created this Path extension function.
Composable that uses this shape
And demonstration