FirefoxUX / photon-icons

The design tokens for the Photon icons
Mozilla Public License 2.0
22 stars 13 forks source link

Avoid fillType="evenOdd" in Android vector drawables. #28

Open pocmo opened 6 years ago

pocmo commented 6 years ago

I wanted to import this vector drawable: https://github.com/FirefoxUX/photon-icons/blob/master/icons/android/pin-outline-24.xml

Android Studio warns me that it uses fillType="evenodd" which is only supported on API level 24 and higher. Most of our apps have a minSdkVersion of 21.

pocmo commented 6 years ago

It turns out that I can just remove the attribute for the two pin icons and they just render fine.

aminalhazwani commented 6 years ago

Oh yeah, I remember you mentioned this @pocmo. Let me look into this!

aminalhazwani commented 6 years ago

After some research it seems that there is no easy fix that doesn't require manual work. A possible alternative solution would be to export drawable-hdpi, drawable-mdpi, drawable-xhdpi, drawable-xxhdpi, and drawable-xxxhdpi for products on Android API < 24. Would that work @pocmo?

pocmo commented 6 years ago

Generating PNGs comes with a big APK size hit and it makes it almost pointless to use SVGs on the other platforms.

aminalhazwani commented 5 years ago

Generating PNGs comes with a big APK size hit and it makes it almost pointless to use SVGs on the other platforms.

@pocmo, I'll try to figure something else out 🙂

cesards commented 5 years ago

What about having a drawable-anydpi folder with fillType="nonZero" and another one: drawable-anydpi-v24with a copy of the vector.xml with fillType="evenOdd"?