I am using TabLayout
of design library what i want to acheive is
I have tried many tutorial and i am able to achieve it by customizing the tab
The Design Library were updated to match the material design "Tabs with icons and text" specs, so you don't need a custom tab view.
But in the current version (23.1.1), only the text colors match the spec (tab focused - #fff, tab unfocused - 70% #fff). So you can use the ColorStateList
returned by getTabTextColors()
to tint the icons using DrawableCompat.setTintList(ColorStateList)
.
Try to use this gist https://gist.github.com/mikovali/7a89b505cd6306bb94a8. Removing the line tabs.setTabTextColors(Color.RED, Color.GREEN)
should be enough to match the spec for both text and icon on dark toolbars.