Skip to content

Instantly share code, notes, and snippets.

@defHLT
Created March 29, 2015 21:05
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 defHLT/8ff44834b4ca4d74ebb9 to your computer and use it in GitHub Desktop.
Save defHLT/8ff44834b4ca4d74ebb9 to your computer and use it in GitHub Desktop.
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