Skip to content

Instantly share code, notes, and snippets.

@bigstark
Created April 6, 2017 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigstark/cc98167e2f05aee50277479cd7b097a1 to your computer and use it in GitHub Desktop.
Save bigstark/cc98167e2f05aee50277479cd7b097a1 to your computer and use it in GitHub Desktop.
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int width = getWidth();
int height = getHeight();
// o ㅡㅡ o
//
//
// o o
resetPaint(0);
float[] circleCenter = getHorizontalCenter(width, height, true);
canvas.drawCircle(circleCenter[0], circleCenter[1], radius, paint);
// o o
// |
// |
// o o
resetPaint(1);
circleCenter = getVerticalCenter(width, height, true);
canvas.drawCircle(circleCenter[0], circleCenter[1], radius, paint);
// o o
//
//
// o ㅡㅡ o
resetPaint(2);
circleCenter = getHorizontalCenter(width, height, false);
canvas.drawCircle(circleCenter[0], circleCenter[1], radius, paint);
// o o
// ㅣ
// ㅣ
// o o
resetPaint(3);
circleCenter = getVerticalCenter(width, height, false);
canvas.drawCircle(circleCenter[0], circleCenter[1], radius, paint);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment