title: Android: Drawing an arc inside a circle
body: <p>I'm trying to draw an arc inside a circle to represent the temperature, but I'm having a difficult time achieving that. During my search I found those solutions</p>
  
  <p><a href="https://stackoverflow.com/questions/22933351/android-donut-chart">This one I couldn't understand what is the scale method for, and is drawing more than one arch, which confused me a bit</a></p>
  
  <p><a href="http://knowledge-cess.com/circle-drawing-and-filling-arc-in-android/" rel="noreferrer">This post gave it a fixed size where I need the size to be controlled by the custom view in my XML layout</a></p>
  
  <p><a href="http://www.cumulations.com/blogs/5/Understanding-Sweep-angle-in-drawArc-method-of-android" rel="noreferrer">From here I understood the concept the degrees but I didn't understand how to determine the oval size</a></p>
  
  <p>What i reached so far</p>
  
  <pre><code>@Override
  protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
  
      int startTop = 0;
      int startLeft = 0;
      int endBottom = getHeight() / 2;
      int endRight = endBottom;// This makes an equal square.
  
      int centerX = getWidth() / 2;
      int centerY = getHeight() / 2;
  
      int upperEdgeX = (int) (centerX + getWidth() / 2 * Math.cos(270 * Math.PI / 180));
      int upperEdgeY = (int) (centerY + getWidth() / 2 * Math.sin(270 * Math.PI / 180));
  
      int bottomEdgeX = (int) (centerX + getWidth() / 2 * Math.cos(90 * Math.PI / 180));
      int bottomEdgeY = (int) (centerY + getWidth() / 2 * Math.sin(90 * Math.PI / 180));
  
      int leftEdgeX = (int) (centerX + getWidth() / 2 * Math.cos(180 * Math.PI / 180));
      int leftEdgeY = (int) (centerY + getWidth() / 2 * Math.sin(180 * Math.PI / 180));
  
      int rightEdgeX = (int) (centerX + getWidth() / 2 * Math.cos(0 * Math.PI / 180));
      int rightEdgeY = (int) (centerY + getWidth() / 2 * Math.sin(0 * Math.PI / 180));
  
      RectF rect = new RectF(startTop, startLeft, endRight, endBottom);
      canvas.drawCircle(centerX, centerY, getWidth() / 2, mBasePaint);
  
  
      canvas.drawCircle(centerX, centerY, getWidth() / 3, mCenterPaint); // White circle
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  I need my view to be like a Donut Pie chart where the middle will hold the degree</p>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>I'm trying to have something like this</p>
  
  <p><a href="https://i.stack.imgur.com/lRMU7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lRMU7.png" alt="enter image description here"></a></p>