{"id":17978125,"url":"https://github.com/misakuo/svgtoandroid","last_synced_at":"2025-04-04T21:07:58.534Z","repository":{"id":47052491,"uuid":"48101364","full_name":"misakuo/svgtoandroid","owner":"misakuo","description":"Converting SVG to VectorDrawable","archived":false,"fork":false,"pushed_at":"2024-01-02T04:49:43.000Z","size":3516,"stargazers_count":530,"open_issues_count":15,"forks_count":45,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-28T20:07:10.991Z","etag":null,"topics":["android","svg","vector-drawable"],"latest_commit_sha":null,"homepage":"https://plugins.jetbrains.com/plugin/8103","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/misakuo.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-16T09:43:27.000Z","updated_at":"2025-03-20T15:14:57.000Z","dependencies_parsed_at":"2024-10-29T17:48:50.935Z","dependency_job_id":null,"html_url":"https://github.com/misakuo/svgtoandroid","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misakuo%2Fsvgtoandroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misakuo%2Fsvgtoandroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misakuo%2Fsvgtoandroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/misakuo%2Fsvgtoandroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/misakuo","download_url":"https://codeload.github.com/misakuo/svgtoandroid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249525,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","svg","vector-drawable"],"created_at":"2024-10-29T17:31:36.917Z","updated_at":"2025-04-04T21:07:58.517Z","avatar_url":"https://github.com/misakuo.png","language":"Java","readme":"## SVG2VectorDrawable  [![Build Status](https://travis-ci.org/misakuo/svgtoandroid.svg?branch=master)](https://travis-ci.org/misakuo/svgtoandroid)\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SVG2VectorDrawable-brightgreen.svg?style=flat)](http://www.android-arsenal.com/details/1/3137)\n![](https://img.shields.io/packagist/l/doctrine/orm.svg)  \n\nREADME:\n[中文](https://github.com/misakuo/svgtoandroid/blob/master/readme.md) | [English](https://github.com/misakuo/svgtoandroid/blob/master/readme_en.md)\n\n### DEPRECATED\nPlease using the **Asset Studio** instead.\n![20201103111801.jpg](https://i.loli.net/2020/11/03/hvomGsdPFrY6R1X.jpg)\n\n### 简介\nIntellij Platform插件，通过其可以完成从svg文件到Android VectorDrawable的自动化转换。\n\n### 特性\n - 图形化界面\n - 自动解析当前Project，如果当前Project为Android Project，则会列出所有Module   \n - 支持将SVG解析为多种dpi的VectorDrawable  \n - 支持SVG的transform属性\n - 支持批量转换指定目录内的所有svg文件\n\n### 属性对应表\n|SVG Attribute|VectorDrawable Attribute|\n|:-:|:-:|\n|id|android:name|\n|fill|android:fillColor|\n|fill-opacity|android:fillAlpha|\n|fill-rule|android:fillType|\n|stroke|android:strokeColor|\n|stroke-opacity|android:strokeAlpha|\n|stroke-width|android:strokeWidth|\n|stroke-linejoin|android:strokeLineJoin|\n|stroke-miterlimit|android:strokeMiterLimit|\n|stroke-linecap|android:lineCap|\n|transform|android:{scaleX/Y \\| translateX/Y \\| pivotX/Y \\| rotation}|\n\n### 使用\n#### 安装  \n本插件支持Intellij IDEA和Android Studio，需要JDK版本1.6+  \n##### 通过本地jar文件安装\n[从此处](https://github.com/misakuo/svgtoandroid/blob/master/svg2android.zip) 下载`svg2android.zip` 文件，在IDE中打开 Preferences -\u003e Plugins -\u003e Install plugin from disk... 选择 svg2android.zip ，添加后重启IDE\n##### 通过插件仓库在线安装\n在IDE中打开Preferences -\u003e Plugins -\u003e Browse Repositories，搜索SVG2VectorDrawable，安装插件并重启IDE\n#### 界面  \n![img1](https://raw.githubusercontent.com/misakuo/svgtoandroid/master/imgs/1.png)\n#### 用法\n##### GUI模式\n![settings](./imgs/single_file.png)\n- 点击`···`按钮，选择一个SVG源文件，或勾选`batch`，并点击`···`选择一个包含svg文件的目录\n- 在第一个下拉选框中选中要生成xml文件的module，在第二个选框中选择生成的VectorDrawable的分辨率\n- 填入生成xml文件的文件名，默认为vector_drawable_ + SVG文件的名称\n- 点击`Generate`，插件会生成出VectorDrawable并在编辑器中打开（默认覆盖同名文件）\n\n注意：在module中已存在的分辨率目录为黑色字体，未存在的目录为灰色字体，如果选中不存在的目录，则插件会自动生成该目录。    \n\n##### Generate模式    \n![settings](./imgs/generate.png)\n- 在任意代码编辑器窗口中呼出`Generate`菜单（例如macOS默认是control+enter）\n- 选择`VectorDrawable`，插件会将指定目录中的所有svg文件转换到当前module的drawable目录中（默认跳过同名文件）\n\n#### 设置项\n打开`Prefreences -\u003e Other Settings`，选择`SVG to VectorDrawable`，打开设置面板   \n\n![settings](./imgs/settings.png)\n\n- SVG source： 设置存放svg文件的默认目录，在Generate模式中将会从该目录获取svg文件    \n- Xml prefix： 设置生成的xml文件名的默认前缀    \n- Auto check for update： 勾选后在每次打开GUI的时候会进行自动版本更新检查操作    \n- Override the existing xml file when generating： 勾选后在生成过程中将会覆盖已存在的同名文件\n\n\n#### 更新日志    \n##### 1.5    \n支持fill-rule属性（该属性目前仅被API 24+支持）    \n添加Generate模式    \n支持批量生成\n##### 1.4.2    \n针对Sketch导出的SVG文件做了优化    \n##### 1.4.1    \n代码优化，更换新Icon\n##### 1.4.0\n支持“transform”属性\n##### Early\n创建项目，bug fix    \n\n*欢迎提交Issue和PR*\n***\nReference: [svg2vectordrawable](https://github.com/Ashung/svg2vectordrawable)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisakuo%2Fsvgtoandroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisakuo%2Fsvgtoandroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisakuo%2Fsvgtoandroid/lists"}