Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Batch converter of SVG images to Android vector drawable XML resource files. Online version of the converter is here:

NotificationsYou must be signed in to change notification settings

a-student/SvgToVectorDrawableConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Batch converter of SVG images to Android VectorDrawable XML resource files.

Put the output XML files into the ‘res/drawable’ directory of your app and reference to them in XML / Java code as to ordinary drawables.

The online version of the converter completely replaced this one.

Please use that instead. This project is obsolete!

Not supported SVG features

These SVG elements are not supported by VectorDrawable:patterns, masks, images, etc.

VectorDrawablefill-rule is alwaysnon-zero and cannot be changed prior to Android 7.0 (Nougat).If you end up with areas filled that should not be filled, that is because the SVG image was created using even-odd rule instead.There are three ways to deal with this problem: try specifying the--fix-fill-type option, manually edit SVGs in vector graphics software or convert for Android 7.0+.

Specifying the--fix-fill-type option

This option is experimental, but it is worth trying first. The option uses complex mathematics to rebuild paths in such a way that rendering with any fill-rule leads to the same result.

Manual editing

If you are using Inkscape, openObjectFill and Stroke… and in theFill tab chooseFill is solid unless a subpath is counterdirectional.If you see improperly filled area after this operation, using F2 tool select subpath around that area and applyPathReverse command from the main menu.

If you are using Sketch, select the path, right to theFills property title there is settings icon, click it and chooseNon-Zero option.To reverse the path direction applyLayerPathsReverse Order command from the main menu.

Converting for Android 7.0

This option does not fit all, because it requires settingminSdkVersion to 24 at least (Android 7.0 or later) in ‘build.gradle’.Alternatively, you can try AndroidX VectorDrawableCompat.

About

Batch converter of SVG images to Android vector drawable XML resource files. Online version of the converter is here:

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp