Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class PagerIndicator extends View {
// The rest of the code
public void setPager(ViewPager pager) {
this.pager = pager;
pager.addOnPageChangeListener(this);
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
// Not used
}
@Override
public void onPageSelected(int position) {
invalidate();
}
@Override
public void onPageScrollStateChanged(int state) {
// Not used
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment