IIUC, Compose doesn't really bring anything new to...
# compose
t
IIUC, Compose doesn't really bring anything new to the "I have SVG icons how do I use them in my app" story. It's still hope you can get them converted to Drawable resources and then use the drawables. As Image composables, I believe? (as opposed to Icon)
e
You can always convert SVGs to an Android Vector Drawable using Android Studio: https://developer.android.com/studio/write/vector-asset-studio That being said. SVG is a huge format, and AVD does not support all the tags. You can see AVDs as a lightweight version of SVG that Android can render efficiently 🙂 Hope this helps a little!
l
You can also use the svg2compose IJ plugin to convert your svg to compose icons. These are cross-platform.
e
TIL. That sounds like another good alternative. Does it crate something to Icons.Filled.<X> ?
t
I'll have to look at that plugin. I've converted our SVG icons for a long time into "older android" implemenations of this app, and it's a pain. Saying it is a "subset" doesn't do the truth justice. I've frequently had to go redraw icons or simplify them, to get the import/convert thing to work correctly. For iOS... I just run:
Copy code
/usr/local/bin/inkscape --export-background-opacity=0 --export-filename=${Target}/${name}.pdf ${PWD}/${name}.svg
to create a PDF that drops right into Assets directory and has worked every single time.