No longer relevant! This issue is related to a bug in old Android 4.x build.
android:tint
should now work correctly as in the example below
I'm trying to apply tint to bitmap inside < layer-list >
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<solid android:color="@color/grey" />
<size android:width="45dp" android:height="45dp"/>
</shape>
</item>
<item android:left="5dp" android:right="5dp" android:top="5dp" android:bottom="5dp">
<bitmap android:src="@drawable/ic_action" android:tint="#FF000000" />
</item>
</layer-list>
Preview shows that it should work, FROM ANDROID-STUDIO:
But it doesn't tint when deployed on device:
It does tint correctly if i use ImageView in my layout, but fails with layer-list. I believe I have tried every tintMode with no results.
setTint()
only with lollipop and maybe it has something to do with that. Testing the app on a lollipop device could help rule that out. – Sackville