Is there any high level guidance for defining vect...
# compose
b
Is there any high level guidance for defining vector drawables in a Compose world? Material defines them as paths in Kotlin files, but we of course still have the ability to define them as vector drawable resources. I’m assuming there’s at least some performance gain in defining them in Kotlin as paths and doing so also enables multiplatform support, but is there a meaningful benefit for an Android-only application?
t
It will save you some miniscule amount of time in aapt, and some runtime costs for converting those resources into ImageVector objects.
n
Compose's vector graphics APIs are more generic and decouple the serialization from the rendering. This differs from VectorDrawable in the fact the parsing from the compiled xml format and drawing are coupled together.
💯 2
t
I actually repurposed the material generator code in our Gradle build to convert some FontAwesome icons, I should make that a plugin
You basically drop SVGs in
src/main/icons
and get generated Kotlin
b
Thanks! Would love to see an SVG -> ImageVector built into Studio as well alongside the existing SVG -> Vector drawable
👍 2
I’ll take a peek at Material’s because I’d love to have that automated using our icon library