- Using Gradle
compile 'com.bikomobile:circleindicatorpager:1.0.0'
- Using Maven
<dependency>
<groupId>com.bikomobile</groupId>
<artifactId>circleindicatorpager</artifactId>
<version>1.0.0</version>
<type>pom</type>
</dependency>
Add View to your layout
<com.bikomobile.circleindicatorpager.CircleIndicatorPager
android:id="@+id/circle_indicator_pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="28dp"
app:ci_drawable="@drawable/blue_radius"
app:ci_drawable_unselected="@drawable/gray_radius"
app:ci_height="7dp"
app:ci_width="7dp" />
In your class, you setter the viewpager to CircleIndicatorPager
CircleIndicatorPager indicator = (CircleIndicatorPager) findViewById(R.id.circle_indicator_pager);
indicator.setViewPager(viewPager);
You can configure the indicator programatically
indicator.configureIndicator(int indicatorWidth, int indicatorHeight, int indicatorMargin,
@DrawableRes int indicatorBackgroundId,
@DrawableRes int indicatorUnselectedBackgroundId)
Attr name | Attr format | Example |
---|---|---|
ci_width | dimension | 5dp |
ci_height | dimension | 5dp |
ci_margin | dimension | 10dp |
ci_drawable | reference | @drawable / @color |
ci_drawable_unselected | reference | @drawable / @color |
ci_orientation | enum | horizontal | vertical |
ci_gravity | enum | top | bottom | left | right | center_vertical | fill_vertical | center_horizontal | fill_horizontal | center | fill | clip_vertical | clip_horizontal | start | end |
## Contribute
## About me
## License