Created
November 20, 2016 02:13
-
-
Save enginebai/e94f7a5d4bd6a8b27a95f1a4f4a94c63 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Override | |
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
final int width = getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec); | |
final int height = getDefaultSize(getSuggestedMinimumHeight(), heightMeasureSpec); | |
final int min = Math.min(width, height); | |
mTranslateX = (int) (width * 0.5f); | |
mTranslateY = (int) (height * 0.5f); | |
int arcDiameter = min - getPaddingLeft(); | |
mArcRadius = arcDiameter / 2; | |
float top = height / 2 - (arcDiameter / 2); | |
float left = width / 2 - (arcDiameter / 2); | |
mArcRect.set(left, top, left + arcDiameter, top + arcDiameter); | |
updateIndicatorIconPosition(); | |
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment