android-viewpager-indicator

Additional

Language
Kotlin
Version
1.0.5 (Jun 29, 2018)
Created
Aug 19, 2016
Updated
Jun 29, 2018
Owner
Ravindu Wijewickrama (ravindu1024)
Contributor
Ravindu Wijewickrama (ravindu1024)
1
Activity
Badge
Generate
Download
Source code
APK file

Advertising

android-viewpager-indicator

A simple customizable indicator for ViewPagers

Installation:

  1. Add the following to the main project gradle file:
 allprojects {
  repositories {
   ...
   maven { url 'https://jitpack.io' }
  }
 }
  1. Add this to the module gradle file:
 dependencies {
         compile 'com.github.ravindu1024:android-viewpager-indicator:1.0.1'
 }

Usage:

  1. add using xml:
    <com.ravindu1024.indicatorlib.ViewPagerIndicator
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal|center_vertical"
        android:id="@+id/pager_indicator"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"/>
  1. Then in code:
    ViewPagerIndicator indicator = (ViewPagerIndicator) findViewById(R.id.pager_indicator);
    indicator.setPager(pager);  //pager - the target ViewPager

NOTE: Changes to the ViewPager pages at runtime will be automatically handled when you call notifyDataSetChanged().