Search code examples
androidandroid-viewpagerpagerviewpagerindicatortabpage

How to change TabPageIndicator style programatically


I have a TabPageIndicator in a Activity. One of of the fragments from the TabPageIndicator contains another TabPageIndicator. The problem is that i want to have different designs for them. For example i want that one of them to have dividers and the other one not but the theme that i apply to the activity is applied to both of the TabPageIndicators. Is there a way to customize them?

PS: so far i have tried to add style attribute to the second TabPageIndicator but it doesn't work.


Solution

  • Quoting from https://github.com/JakeWharton/Android-ViewPagerIndicator/issues/134 :

    The TabPageIndicator is creating using real views rather than being drawn on a Canvas which necessitates using styles and drawables to style it. This simply cannot be done with Android's style system.