Created
March 29, 2015 21:05
-
-
Save defHLT/8ff44834b4ca4d74ebb9 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
private void init() { | |
paint = new Paint(); | |
paint.setColor(Color.BLUE); | |
paint.setAntiAlias(true); | |
paint.setStrokeWidth(50); | |
paint.setStyle(Paint.Style.STROKE); | |
paintFill = new Paint(); | |
paintFill.setColor(Color.RED); | |
paint.setAntiAlias(true); | |
paintFill.setStrokeWidth(50); | |
} | |
@Override | |
protected void onDraw(Canvas canvas) { | |
super.onDraw(canvas); | |
float w = canvas.getWidth(); | |
float h = canvas.getHeight(); | |
float center_x = w/2f; | |
float center_y = h/2f; | |
float r = w * 0.4f; | |
canvas.drawCircle(center_x, center_y, r + 25, paintFill); | |
RectF rect = new RectF(center_x - r, center_y - r, center_x + r, center_y + r); | |
canvas.drawArc(rect, 0, 90, false, paint); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment