Android, Blog

How to Create PagerTitleStrip with Current Page Indicator Only

Karol Wrótniak

Karol WrótniakAndroid Developer

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 android.support.v4.view hierarchy.

Code ready to use is available as a gist.

The post is written by Droids On Roids Team Member.
We would love to take care of your app.

Leave comment