Code example for Canvas

Methods: drawArc, drawBitmap, drawCircle

0
	@Override 
	protected void onDraw(Canvas canvas) {
		dx = getXFromAngle();
		dy = getYFromAngle();
 
		canvas.drawCircle(cx, cy, outerRadius, circleRing);
		canvas.drawArc(rect, startAngle, angle, true, circleColor);
		canvas.drawCircle(cx, cy, innerRadius, innerColor);
		drawMarkerAtProgress(canvas);
 
		super.onDraw(canvas);
	} 
 
	/** 
	 * Draw marker at the current progress point onto the given canvas. 
	 *  
	 * @param canvas 
	 *            the canvas 
	 */ 
	public void drawMarkerAtProgress(Canvas canvas) {
		if (IS_PRESSED) {
			canvas.drawBitmap(progressMarkPressed, dx, dy, null);
		} else { 
			canvas.drawBitmap(progressMark, dx, dy, null);
		} 
	} 
 
	/** 
	 * Gets the X coordinate of the arc's end arm's point of intersection with