I have a working TabLayout, and I am trying to update the tab text color dynamically, when changing tabs. To do this, I call the setTabTextColors()
method on my TabLayout as such:
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
tabLayout.setTabTextColors(newColorStateList);
}
(...)
});
For some reason, the text color doesn't update. Does anyone know how to update the tab text color dynamically?
I am using the Design Support Library v22.2.0.