Why common Compose operations like clip and border...
# compose
m
Why common Compose operations like clip and border allowing creation of shapes are not supported in the Android framework or are somehow hidden from the average developer?
r
What do you mean? You'd want features like borders to work on Views for instance?
m
Yes, I looked up material.io, which is mostly specifications on shapes for example and no Android implementations are provided.
But, I see nice shapes in some Google apps like Keep and Google Photos Widget. How are these outlines created?
m
It's rather limited. I can only get round and rectangular outlines using such shapes defined as drawables and then used as background. I don't find an easy way to create custom outlines and borders in non-Compose code.
a
You can use any path by overriding
getOutline
method of
ViewOutlineProvider
and using
Outline.setPath
(or any other methods in
Outline
class).