code: public void setProgress(float progress) {
      if (isSpinning) {
        mProgress = 0.0f;
        isSpinning = false;
  
        runCallback();
      }
  
      if (progress > 1.0f) {
        progress -= 1.0f;
      } else if (progress < 0) {
        progress = 0;
      }
  
      if (progress == mTargetProgress) {
        return;
      }
  
      // If we are currently in the right position
      // we set again the last time animated so the
      // animation starts smooth from here
      if (mProgress == mTargetProgress) {
        lastTimeAnimated = SystemClock.uptimeMillis();
      }
  
      mTargetProgress = Math.min(progress * 360.0f, 360.0f);
  
      invalidate();
    }
docs: Set the progress to a specific value,
  the bar will smoothly animate until that value
  
  @param progress the progress between 0 and 1