Skip to content

Instantly share code, notes, and snippets.

Created Sep 19, 2016
What would you like to do?
public class PagerIndicator extends View {
// Constructors and other methods
protected void onDraw(Canvas canvas) {
if (isInEditMode()) {
drawDots(canvas, 5, 2);
if (pager != null) {
int total = pager.getAdapter().getCount();
int currentPage = pager.getCurrentItem();
drawDots(canvas, total, currentPage);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment