avianey / androidsvgdrawable-plugin

Gradle plugin that generates qualified, density specific PNG drawables from SVG files at build time for your Android projects.
Apache License 2.0
262 stars 29 forks source link

Support XML vector drawables #28

Open schildbach opened 9 years ago

schildbach commented 9 years ago

Vector drawables are basically a subset of SVG, but on Android 5+ they can be used directly, instead of bitmaps. It would be nice if I could use this plugin to generate a couple of fallback bitmaps for the older Android versions.

avianey commented 9 years ago

https://developer.android.com/reference/android/graphics/drawable/VectorDrawable.html https://github.com/inloop/svg2android https://github.com/telly/MrVector

avianey commented 9 years ago

Will try but maybe later... The primary goal of this plugin is to generate drawable/mipmap for every density from a scalable vector graphic (svg)... VectorDrawable are actually already scalable so I doupt it needs to be added in this plugin or might be generated into drawable-v21

schildbach commented 9 years ago

On API 21 and above, of course the vector drawables would be used directly. I was just looking for a way to generate the fallback PNG drawables for API 20 and below automatically and thought this project would fit.

avianey commented 9 years ago

Can look after VectorDrawableCompat

schildbach commented 9 years ago

VectorDrawableCompat is meant for runtime, and it's a pain to use. I'm looking for an easy solution at build time.

avianey commented 9 years ago

Have to see the spec. Should be easy to convert to svg using xslt...

schildbach commented 9 years ago

I'm watching the "What’s new in Android Development Tools" talk from this year's Google I/O and guess what, at the 3 minute mark they announce just this feature (+ big applause). Now I'm looking for how to use it.

avianey commented 9 years ago

v 1.4.0-beta1 of http://tools.android.com/tech-docs/new-build-system add the functionnality

Vector drawable support for generating PNGs at build time.