i've had a drawable resource for a selectable Button/ImageView like this:
<selector>
<item android:state_selected="true">
<layer-list>
<item>
<shape android:shape="oval">
<solid android:color="@color/blue"/>
</shape>
</item>
<item>
<bitmap
android:src="@drawable/ic_icon"
android:tint="@color/white"/>
</item>
</layer-list>
</item>
<item>
<layer-list>
<item>
<shape android:shape="oval">
<solid android:color="@color/background_unselected"/>
</shape>
</item>
<item>
<bitmap
android:src="@drawable/ic_icon"
android:tint="@color/icon_unselected"/>
</item>
</layer-list>
</item>
as i've switched to use VectorDrawables the above declaration does not work because i cannot reference a VectorDrawable with a <bitmap>
tag.
But as far as i know that's the only way i can tint the icon.
I also cannot apply a Colorfilter in code as this would tint the whole drawable and not just the icon.
Any suggestions?