SVG2VectorDrawable
??
Intellij Platform???????????svg???Android VectorDrawable???????
??
- ?????
- ??????Project?????Project?Android Project???????Module
- ???SVG?????dpi?VectorDrawable
- ??SVG?transform??
- ??????????????svg??
?????
SVG Attribute | VectorDrawable Attribute |
---|---|
id | android:name |
fill | android:fillColor |
fill-opacity | android:fillAlpha |
fill-rule | android:fillType |
stroke | android:strokeColor |
stroke-opacity | android:strokeAlpha |
stroke-width | android:strokeWidth |
stroke-linejoin | android:strokeLineJoin |
stroke-miterlimit | android:strokeMiterLimit |
stroke-linecap | android:lineCap |
transform | android:{ scaleX/Y | translateX/Y | pivotX/Y | rotation } |
??
??
?????Intellij IDEA?Android Studio???JDK??1.6+
????jar????
??? ?? svg2android.zip
????IDE??? Preferences -> Plugins -> Install plugin from disk... ?? svg2android.zip ??????IDE
??????????
?IDE???Preferences -> Plugins -> Browse Repositories???SVG2VectorDrawable????????IDE
??
??
GUI??
- ??
···
???????SVG???????batch
????···
??????svg????? - ??????????????xml???module?????????????VectorDrawable????
- ????xml??????????vector_drawable_ + SVG?????
- ??
Generate
???????VectorDrawable??????????????????
????module???????????????????????????????????????????????????
Generate??
- ?????????????
Generate
?????macOS???control+enter? - ??
VectorDrawable
?????????????svg???????module?drawable?????????????
???
?? Prefreences -> Other Settings
??? SVG to VectorDrawable
???????
- SVG source? ????svg?????????Generate???????????svg??
- Xml prefix? ?????xml????????
- Auto check for update? ????????GUI????????????????
- Override the existing xml file when generating? ?????????????????????
????
1.5
??fill-rule??????????API 24+???
??Generate??
??????
1.4.2
??Sketch???SVG??????
1.4.1
????????Icon
1.4.0
??“transform”??
Early
?????bug fix
????Issue?PR
Reference: svg2vectordrawable