title: Android draw circle with Path
body: <p>I'm trying to animate drawing out a circle. In my custom view, I have</p>
  
  <pre><code>private final Paint mPaint = new Paint() {
      {
          setDither(true);
          setStyle(Paint.Style.STROKE);
          setStrokeCap(Paint.Cap.ROUND);
          setStrokeJoin(Paint.Join.ROUND);
          setColor(Color.BLUE);
          setStrokeWidth(30.0f);
          setAntiAlias(true);
      }
  };
  ...
  protected void onDraw(Canvas canvas) {
      super.onDraw();
      if (mOval == null) {
          mOval = new RectF(getLeft(), getTop(), getRight(), getBottom());
      }
      if (mPath == null) {
          mPath = new Path();
      mPath.moveTo(0, getHeight() / 2);
      }
  
      float sweepAngle = Math.min((float) mElapsedTime / 1000 * 60 * 1, 1) * 360;
      if (sweepAngle == 0) {
          mPath.reset();
      } else if (mCurrentAngle != sweepAngle) {
      mPath.arcTo(mOval, mCurrentAngle, sweepAngle);
      }
      mCurrentAngle = sweepAngle;
      canvas.drawPath(mPath, mPaint);
  }
  </code></pre>
  
  <p>At intervals, I'm updating <code>mElapsedTime</code> and calling <code>invalidate()</code>. However, nothing is drawn on the screen. I've tried several variations, but to no avail. Is there something I'm doing wrong? Is there an easier way to do this? Given a percentage of a circle, I want to be able to make that much of the circle be what is drawn on the screen.</p>