Aracem
Aracem

Reputation: 7207

Use VectorDrawables in a Bitmap XML and tint them

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

We already have an Icon Kit with all the icons of our app, all in a black color and the idea is to use them and tint in each usage with the appropriate color. This works (more or less) perfectly until you try to made the same in a layer-list/selector/similar, where you need to include an item with a <bitmap> or similar and... I don't find how to tint a VectorDrawable that also works in <21 devices

The pre-requisite is to not need to make it programmatically, I know that is possible but made it programmatically breaks all the easy usage of the icons and, also, not has sense.

In resume, Is there any form to use VectorDrawable in a <Bitmap> XML and tint it working in <21 devices and not programmatically?

Upvotes: 6

Views: 1772

Answers (1)

alorma
alorma

Reputation: 954

The short answer: No, you can't do that.

The extended version:

Copy the SVG and apply color:

icon_a.xml
icon_b.xml (with color changed)

Upvotes: 11

Related Questions