Use VectorDrawables in XML Bitmap format and darken them

We are trying to move all of our app icon resources to VectorDrawables to reduce the size of the app and easily manage the set of app icons.

We already have an Icon Kit with all our app icons, all in black, and the idea is to use them and shade each use with the appropriate color. This works (more or less) perfectly, until you try to do the same in layer-list

/ selector

/ like where you need to include an element with <bitmap>

or similar and ... I don't find how to tint a VectorDrawable

which also works in <21 devices

The prerequisite is that it doesn't have to be done programmatically, I know it is possible, but made it programmatically breaking all easy use of icons and also makes no sense.

On resume, is there any form to use VectorDrawable

in XML <bitmap>

and then it works in <21 devices and not programmatically?

+3


source to share


1 answer


The short answer is: No, you cannot do this.

Extended version:



Copy SVG and apply color:

icon_a.xml
icon_b.xml (with color changed)

      

+6


source







All Articles