Insprite and modified from CircleIndicator.
Add the JitPack repository to your build.gradle:
repositories {
maven { url "https://jitpack.io" }
}
Add the dependency:
dependencies {
compile 'com.github.nekocode:ToolbarIndicator:v1.0'
}
Set the target ViewPager for ToolbarIndicator:
ToolbarIndicator toolbarIndicator = (ToolbarIndicator) this.findViewById(R.id.indicator);
toolbarIndicator.setViewPager(viewPager);
The ToolbarIndicator get titles from FragmentPagerAdapter's getPageTitle function, for more detail you can check about the sample project.