Canvas 클래스는 당신이 필요로 수행하는 기능 drawArc을 가지고 있습니다.
이 코드는 당신에게 힌트를 제공합니다.
private static final int ARCS_COUNT = 4;
private static final int SWEEP_ANGLE = 360/(ARCS_COUNT+1); // 72
private static final int[] colours =
new int[] {Color.RED, Color.YELLOW, Color.GREEN, Color.BLUE};
.....
Paint p = new Paint();
p.SetStyle(PaintStyle.STROKE);
p.setStrokeWidth(4):
// Point (50,50) will be the centre of the bar.
RectF rectF = new RectF(0,0,100,100);
int startAngle = 180;
for (int i = 0; i<ARCS_COUNT; i++) {
p.setColor(colours[i]);
canvas.drawArc(rectF, startAngle, SWEEP_ANGLE, false, p);
startAngle += SWEEP_ANGLE;
}