-
Notifications
You must be signed in to change notification settings - Fork 3
File format conventions
Jules edited this page Apr 5, 2024
·
4 revisions
- Format the code in Android Studio.
- Optimize and compress SVGs with SVGO.
- Add a newline (empty line) to the end of each file.
To check XML files, make sure to open them in Android Studio in order to receive warnings from the software itself.
- The XML data should ideally not have any warnings (e.g. LongVector).
- Try to use avocado to further compress XMLs with long paths.
- Some shapes are complex and will render long paths no matter how much compression is done. As a last resort, add the attribute
tools:ignore="VectorPath"
to the culprit<path />
. This will also require you to addxmlns:tools="http://schemas.android.com/tools"
to the<vector />
itself.- Also add
VectorRaster
to the ignore attribute iftools:targetApi="n"
appears in the XML (e.g.tools:ignore="VectorPath,VectorRaster"
)
- Also add
- Avoid
android:fillType=“evenOdd”
if possible, unless removing this attribute negatively affects the graphic of the icon itself.- Make sure to visually check within the preview in Android Studio if removing this attribute causes any issues.
- If the path of an icon requires this attribute, you should then add the attribute
tools:targetApi="n"
to the culprit<path />
. This will also require you to addxmlns:tools="http://schemas.android.com/tools"
to the<vector />
itself.