https://kotlinlang.org logo
#compose
Title
# compose
m

Marc

03/10/2023, 7:34 AM
hello! noob question here: I’m trying to implement something like this (see attached gif) with compose and I’m not sure what would be the best solution, perhaps I’m thinking that creating a custom view with canvas would be the path to follow but I don’t know if there could be a better solution, thanks for any idea of guidance in advance!
e

ephemient

03/10/2023, 9:58 AM
you could implement custom drawing, but if this is all, you shouldn't need to. a custom outline should be enough
BTW, the math for the circular one is pretty straightforward, whether you want it oval if the dimensions are non-square (which I did here for simplicity) or pill-shaped (which you can achieve by adding radii to the previous rectangular shape)
m

Marc

03/10/2023, 6:33 PM
you are amazing!
3 Views