I have a bunch of drawables (icons) defined similar to this (from Google's Open Source Material Icons):
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,4H4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2V6c0,-1.11 -0.89,-2 -2,-2zm0,14H4v-6h16v6zm0,-10H4V6h16v2z"/>
</vector>
I need to change the color via styling. It is used in code as follows:
<ImageView
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1"
android:contentDescription="@string/cd.icon_amount"
android:src="@drawable/ic_local_atm_24dp"/>
But how do you change the color in the ImageView via an external style file?
For example, how do I apply the below XML snippet?
<style name="icon">
<item name="color">@color/grey</item>
</style>
Update 1: I wanted to change the color in XML via a style section in an external file than the shape file. I do not want it done programmatically.