Skip to content

r-cohen/DiscreteScrollViewIndicator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DiscreteScrollViewIndicator

A page indicator for DiscreteScrollView Android library

Simple Usage

DiscreteScrollViewIndicator pageIndicator = DiscreteScrollViewIndicator.Builder(discreteScrollView);
discreteScrollView.addItemDecoration(pageIndicator);

Customize

float DP = Resources.getSystem().getDisplayMetrics().density;
DiscreteScrollViewIndicator pageIndicator = DiscreteScrollViewIndicator.Builder(discreteScrollView)
	.setColorActive(getColor(R.color.ap_white))
	.setColorInactive(getColor(R.color.pagerItem))
	.setIndicatorStrokeWidth(4 * DP)
	.setIndicatorItemPadding(10 * DP)
	.align(DiscreteScrollViewIndicator.Alignment.PARENT_TOP)
	.matchParentWidth();
discreteScrollView.addItemDecoration(pageIndicator);

Usage with InfinitePagerAdapter & InfiniteScrollAdapter

The indicator automatically attempts to fetch the number of items through the adapter unless you set it manually as follows.

pageIndicator.setItemsCount(itemsCount);

Inspired by

bleeding182's recyclerviewItemDecorations

About

A page indicator for DiscreteScrollView Android component

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages