Use fillType = "evenOdd" on Android 21

I have an SVG image that I want to include in an Android project.

The minSdk version for the project is 9. Android Studio creates PNG files for SVG.

However, for API 21+, Android Studio includes SVG in its resource folder drawable-anydpi-v21.

This means that any device using API 21 and above will use SVG instead of PNG.

And this is the problem: for my SVG is required android:fillType="evenOdd".

PNGs are correctly generated, but for SVG, since this API attribute is 24+, it is ignored on API 21 devices, and the image appears full, and not as a wireframe image.

Is it possible to convince Android studio to include only PNG and completely remove SVG?

Is there any other solution for this?

+4
source share
1 answer

you can convert your svg to xml files, which will solve your problem, here is the link to convert svg to xml svgToXML files

0
source

Source: https://habr.com/ru/post/1663982/


All Articles