Has anyone tried to implement overlap style like t...
# compose
t
Has anyone tried to implement overlap style like this in compose?
a
I would do it like this: Draw green opaque background with pill shape, draw light green pill shape for the bottom part, draw green striped pill shape from the very top until where the pill ends, this should yield the results you need
t
Thanks for the idea. I thought there would be other way like implement custom
PorterDuff
or some sort. I’ll try drawing it manually your way.
a
There probably is, but the performance gain would probably too insignificant compared to the implementation needs. Also consider the next teammate who has to read your code, if they have to think about porter-duff magic they will need more time to understand this code which will waste time that could have been used for more productive work, all for (possibly) negligible performance gains
it’s not 2010 anymore 🙂 devices are super powerful now compared to when we had to worry about these things 👍
don’t let me stop you from trying things out for yourself in private projects though, you will definitely learn 😄
t
I’ll definitely try the porter-duff stuff just to explore later but for now I’ll go with the easily understandable first. Thanks for the insight! 🙌