Code example for RectF

0
        canvas.drawColor(Color.TRANSPARENT);
        int width = getMeasuredWidth();
        int height = getMeasuredHeight();
 
        int h = Math.min(width, height);
        RectF oval2 = new RectF((width - h) / 2, (height - h) / 2, h + (width - h) / 2, h + (height - h) / 2);
        if (getProgress() < 360) { 
            mPaint.setColor(Color.parseColor("#33B5E5"));
            canvas.drawArc(oval2, 180, getProgress(), true, mPaint);
        } else { 
            mPaint.setColor(Color.TRANSPARENT);
            canvas.drawArc(oval2, 180, 360, true, mPaint);
        } 
    } 
 
    private int getProgress() { 
        return 360 * progress / max;
    } 
 
    public void setMax(int number) {
Contextual code suggestions in your IDE  Get Codota for Java