Images instead of title texts in tabs of ViewPagerIndicator widget

android, android-viewpager, viewpagerindicator

Solution

There is no built-in image indicator available in the Android Support package.

That being said, you can:

Step #1: Download the source for the ViewPagerIndicator library.

Step #2: Create your own `PagerIndicator` implementation, probably based on the library's `TabPageIndicator`, that uses `ImageView` instead of `TextView`... possibly by means of your `PagerAdapter` implementing some other interface that can expose what image to use for a given tab.

Step #3: Use your `PagerIndicator` the same way as the library indicates you can use any of the built-in ones.

Problem

I am new to Android development. I managed to implement ViewPagerIndicator, and would like to know whether it is possible to use images instead of tab titles. If yes, I'd like to know how. If not, what other options do we have out there? Thanks in advance...

Original source