In Android Studio, we can use VectorDrawable to draw icons, for example, ic_launcher_foreground.xml
and ic_launcher_background.xml
. This results in a beautiful launcher icon with no jaggies,
since the icon is defined by vectors.
While it is possible to convert Scalable Vectory Graphics (SVG) to VectorDrawable using Configure Vector Asset, there is no tool to edit VectorDrawable. In our favour is the fact that VectorDrawable is quite similar to SVG.
The following VectorDrawble elements and attributes map to SVG
<vector>
maps to <svg>
. While you are at it, remove the attributes xmlns:aatp
and
xmlns:android
android:viewportHeight
and android:viewportWidth
with viewBox="0 0 w h"
android:height
and android:width
with height
and width
<path>
elements,
android:fillColor
with fill
, or fill="none"
if the attribute does
not exist
android:pathData
with d
android:fillType
with fill-rule
, and change the value to lower case
android:strokeWidth
with stroke-width
android:strokeColor
with stroke
and stroke-opacity
<defs>
, and the gradient definition
The SVG icon may now be edited with your favourite SVG edit