inloop / svg2android

SVG to Android VectorDrawable XML resource file
http://inloop.github.io/svg2android
Apache License 2.0
1.71k stars 357 forks source link

Implemented linear and radial gradients for fill and stroke colors. #93

Open winsock opened 6 years ago

winsock commented 6 years ago

I have not tested this extensively. It was a quick hack of the code so I didn't have to manually import all of the SVGs with gradients into Android Studio. For the 41 SVGs I tested it with it worked properly. One outstanding issue is that I didn't bother with making sure indentation worked properly.

yuraj11 commented 6 years ago

It looks OK but It does not work correctly on this - could you please check It? Also when I try to build the project It shows me error:

Error while processing C:\Users\Yuraj\Repos\Experiments2\app\src\main\res\drawable\aa.xml : Start point cannot equalendpoint

problematic_drawing.zip

yuraj11 commented 6 years ago

@winsock Could you please check my SVG and try convert with your changes? Because It does not correctly generates <gradient block

ddobrev commented 6 years ago

@winsock thank you for your work. Could you please finish it? @yuraj11 in case @winsock is unable to continue, could you please finish his work? This feature is really important.

winsock commented 6 years ago

@yuraj11 @ddobrev I apologize for the really late response for addressing these issues. I have been slammed at work with a project leaving almost no free time.

Your test SVG now renders properly. Apparently there were a couple of issues, substituteUseRef wasn't copying children and Inkscape was using style attributes for stop-color and opacity unlike Adobe Illustrator setting those as their own attributes.

winsock commented 6 years ago

Just rebased and squashed as well to make this merge cleaner