Category: Android, Blog, Development

How to Create PagerTitleStrip with Current Page Indicator Only

Creating PagerTitleStrip with Current Page Indicator Only

Create PagerTitleStrip only with Current Page Indicator. Find out, how to do this!

Original PagerTitleStrip displays indicators of the current, next, and previous pages of the ViewPager, but sometimes only current is needed. It looks like the others can be hidden by setting non-primary alpha value to zero but despite that shadows can appear.

TextViews containing mentioned indicators are not exposed, so it is not possible to set their visibility even by extending PagerTitleStrip. However, it is possible to create an own class in hierarchy.

Code ready to use is available as a gist.

Start working on you app right away!

Receive your first working demo within 7 days from the project kick-off

Not ready for an estimate?
Attend Product Design Workshop to clarify your vision and prepare the crucial documentation.