Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pocmo opened this issue Jul 10, 2018 · 6 comments
Open

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

pocmo opened this issue Jul 10, 2018 · 6 comments

Comments

@pocmo
Copy link

pocmo commented Jul 10, 2018

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
Copy link
Author

pocmo commented Jul 10, 2018

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

@aminalhazwani
Copy link
Collaborator

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

@aminalhazwani
Copy link
Collaborator

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
Copy link
Author

pocmo commented Aug 20, 2018

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

@aminalhazwani
Copy link
Collaborator

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
Copy link

cesards commented May 23, 2019

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"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants