I have a strange bug.
I have image as vector asset. It is created correct and see like:
I'm using it like menu icon on drawer:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/about"
android:icon="@drawable/ic_about_us"
android:title="@string/navigation_about" />
</group>
</menu>
But in device it looked broken:
Do you see images on the background? It's vector assets too, but they works fine. I place it from code.
I have the similar problem with ViewPager icons. It seems like only icons are broken. So i have two vector assets:
I set this icons two different way(specially):
layout_tab.getTabAt(0)?.icon = activity?.getDrawable(R.drawable.ic_type_bird)
layout_tab.getTabAt(1)?.setIcon(R.drawable.ic_hints)
And then i see:
One:
Two:
What is going on, why my assets broken?
Your assets are not broken, it is just that the navigation drawer automatically applies a color filter to the icons which makes them appear gray. It is similar for the tabbar (as it is trying to show the state)
The answer here shows how to stop this