Hi everyone :wave: I would like to create a Compos...
# compose
b
Hi everyone 👋 I would like to create a Composable that looks like the first picture : rounded corners (circle shape) only on the right side. Do do that I use
RoundedCornerShape(0.dp, 28.dp, 28.dp, 0.dp)
. the problem is that I need to keep them same CornerSize even when the composable width is really small (see the second picture). RoundedCornerShape adapts the corner size (see the third picture in greyscale) does anyone have a hint on how to achieve such rendering ? Many thanks !
t
Maybe use percentage instead?
RoundedCornerShape(topEndPercentage = 100, bottomEndPercentage = 100)
👍 1
d
@Tin Tran I think this would round corners from both sides.
l
That’s it, RoundedCornerShape supports percentages, for individual corners as well
b
using percentages results in the same shape (see picture 3) when width is really small
it's because of CornerBasedShape internals. CornizerSize is adapted when width is less than what the CornerSize asks for. I don't know if I need to dive into creating my Shape or looking for another way to render this
t
I think in this case you’ll have to create your own shape