Change colour indicator in SlidingTabLayout
android
Solution
Just to make it more clear.
SlidingTabLayout tabs = (SlidingTabLayout) findViewById(R.id.sliding_tabs); //referring the layout in xml file
tabs.setViewPager(viewpager); //setting the viewpager
//setting indicator and divider color
tabs.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() {
@Override
public int getIndicatorColor(int position) {
return getResources().getColor(R.color.white); //define any color in xml resources and set it here, I have used white
}
@Override
public int getDividerColor(int position) {
return getResources().getColor(R.color.white);
}
});
Problem
I wish to ask that is it possible to change the colour of the tab indicator in the SlidingTablayout? Must I use SlidingTabsColors from developer.android.com? I just want to change another colour instead of the default blue(I think) colour. Please advise. Thanks!!!