I'm designing a custom widget which have a gauge similar to this blue one :
(except this is a continuous gauge and not a splited one)
I tried to draw a path with two arcs :
private void drawGauge(Canvas canvas) {
canvas.save(Canvas.MATRIX_SAVE_FLAG);
float degreesToDraw = positionToDegree();
gaugePath.addArc(secondArcRect, 90, degreesToDraw);
gaugePath.addArc(faceRect, 90, degreesToDraw);
gaugePath.close();
canvas.drawPath(gaugePath, gaugePaint);
canvas.restore();
}
my two arcs are well drawn but the gaugePath.close()
don't work as excepted since it close the path with the gauge start points (lower points). What I want is to draw a line between the two end points of the arcs(the higher points).
Unfortunately, I've no idea about how to find their coordinates to draw this wanted line.
FYI, I'm currently drawing this :
Any idea/help ? :)