Closed romainpiel closed 8 years ago
This is awesome. I think we'd want to add an option to convert to PNG vs. Android drawable, just so people can have a safe upgrade path.
One other question - why is gradle-svg2android tied to Gradle vs. being a standalone Java process?
Awesome, I have a 7 hours flight tomorrow, I'll take this time to tidy up the PR. I made my repo tied to gradle because I wanted to expose a gradle task. But you're right, it would be cleaner to expose just a standalone java library and to move the gradle task here. I'll work on that :+1:
I think it's much more clean now if you want to have a look:
Travis is not passing because the job doesn't do a clean.
I've merged the tasks and removed the usage of generateVectorDrawables
in the sample. I'm still not sure what to do with https://github.com/trello/victor/pull/43#discussion_r60452265
regarding https://github.com/trello/victor/pull/43#discussion_r60452328, this is a bug in the Android Studio source code. I've just reported it, so I'll merge it in svg2android as soon as it gets fixed: http://b.android.com/208216
This looks good to me. Let's see what happens with it!
This is not merge-able as it is, I just want to open a discussion.
As an attempt to fix #27 I copied the sources from the Android Studio SVG to Android Vectors converter and made a gradle task based on it: https://github.com/RomainPiel/gradle-svg2android
I modified Victor so that it converts SVGs to Android Vectors instead of PNGs and it's working pretty well with the sample. SVG2Android hasn't been uploaded to maven central or bintray, I've only played with it with mavenLocal. So to test this PR:
cd gradle-svg2android && ./gradlew install
I think a reasonable plan could be to add an option to victor to switch the export format between png and xml. Then while this appears to be stable, we can remove completely
RasterizeTask
and only useSVG2AndroidTask
.Limitation:
pt
so I converted all of them topx
If you think it's useful, either: