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
tad
03/09/2021, 7:54 PM
It will save you some miniscule amount of time in aapt, and some runtime costs for converting those resources into ImageVector objects.
n
Nader Jawad
03/09/2021, 7:54 PM
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.