A simple ViewPager indicator implementation compatible with the Android Support Library. It can use arrows on the left and on right and it can display a pageIndicator.
Add it in your project's build.gradle at the end of repositories:
repositories {
// ...
maven { url "https://jitpack.io" }
}
Step 2. Add the dependency in the form
dependencies {
compile 'com.github.kassisdion:ViewPagerWithIndicator:v1.0'
}
<com.kassisdion.library.ViewPagerWithIndicator
app:arrow.enable="true"
app:arrow.width="50dip"
app:arrow.height="50dip"
app:left_arrow.drawable="@drawable/ic_action_arrow_left"
app:right_arrow.drawable="@drawable/ic_action_arrow_right"
app:round.enable="true"
app:round.size="15dip"
app:round.drawable="@drawable/background_rounded"
app:round.color.default="@android:color/white"
app:round.color.selected="@android:color/holo_blue_light"
android:id="@+id/viewPagerWithIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.kassisdion.library.ViewPagerWithIndicator>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Set the pager with an adapter
ViewPager pager = (ViewPager)findViewById(R.id.pager);
List<Integer> objects = Arrays.asList(Color.BLUE, Color.GREEN, Color.RED);
pager.setAdapter(new ViewPagerCustomAdapter(objects));
//Bind the title indicator to the adapter
ViewPagerWithIndicator viewPagerWithIndicator = (ViewPagerWithIndicator)findViewById(R.id.viewPagerWithIndicator);
viewPagerWithIndicator.setViewPager(pager);
}
For a working implementation of this project see the app/ folder.
You can take a look at the javadoc
See LICENSE.txt
If you have any new idea about this project, feel free to contact me.