-
-
Save Gazer/dc1f39f6c5787a0d19240350855b5ca2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PagerIndicator extends View { | |
// Constructors and other methods | |
@Override | |
protected void onDraw(Canvas canvas) { | |
super.onDraw(canvas); | |
if (isInEditMode()) { | |
drawDots(canvas, 5, 2); | |
return; | |
} | |
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