I want to replace all .PNG resources (icons) in my project with vector versions. And for this to be as efficient as possible, i wanted to avoid duplication of images because of different states (like for "active" and "inactive" versions of the same icon).
Previously i've done that by using separate PNG files for each version: an opaque "active", and slightly transparent "inactive".
So the question is, is it possible to create some XMLs which reference a single vector (preferably) image but apply different colors/tints to it? Or at least different alpha values would be enough.
P.S. My minSDK version is 19, if it matters.
UPDATE_01: I think i need to explain in a bit more details. Vector resources are working as expected (all preparations are made for compat lib to draw vectors as needed).
The main problem is to use one single vector icon and multiple references of it with different colors/alphas in separate XMLs. And use these XMLs where needed (on toolbar, buttons, states, etc.).
UPDATE_02: Perhaps and example would be better.
I have a vector drawable of a "home" icon, which looks like this:
<vector
android:height="24dp"
android:viewportHeight="792.0"
android:viewportWidth="792.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#FF000000"
android:pathData="..."/>
</vector>
What i want is to use this same XML vector drawable but with different tints for "active" and "inactive" states, for example, in a page adapter's tabs.
What i do now for this is duplicate this XML and change it's "android:fillColor" value.
Mutating it (in code) in all the places it is used is one way, but not very good from my point of view. Perhaps there is another way? Something like this (pseudo):
<image-reference
android:srcDrawable="@drawable/home_icon"
android:tint="@color/activeHomeIcon" />
And then just use this "home_icon_ref.xml" everywhere as a drawable source.
Hope this makes my question more clear this time.