material design - TabLayout - set a particular tab/TabItem background color unselected

132 views Asked by At

I have been working on material TabLayout and there is a condition where I have to unselect all tabs at once. I know that isn't possible and violates material guidelines. So I thought of maybe changing the particular background color of current tab to show as unselected. I set TabLayout.setBackground(ContextCompat.getDrawable(getContext, R.drawable.selector_state_reversed)) but it didn't work. I also used TabLayout.setSelected(false) but it only worked for the first time after the fragment is created. Any guide, help or suggestions would be greatly appreciated!

0

There are 0 answers