Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 806
Aracem Avatar asked Jun 06 '17 13:06

Aracem


1 Answers

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)
like image 75
alorma Avatar answered Sep 17 '22 23:09

alorma