diff --git a/src/main/java/com/budiyev/android/circularprogressbar/CircularProgressBar.java b/src/main/java/com/budiyev/android/circularprogressbar/CircularProgressBar.java index bf7c97b..1b361d5 100644 --- a/src/main/java/com/budiyev/android/circularprogressbar/CircularProgressBar.java +++ b/src/main/java/com/budiyev/android/circularprogressbar/CircularProgressBar.java @@ -611,16 +611,14 @@ public void onAnimationRepeat(Animator animation) { private final class SweepRestartAction implements Runnable { @Override public void run() { - boolean growMode = !mIndeterminateGrowMode; - mIndeterminateGrowMode = growMode; - if (growMode) { + mIndeterminateGrowMode = !mIndeterminateGrowMode; + if (mIndeterminateGrowMode) { mIndeterminateOffsetAngle = (mIndeterminateOffsetAngle + mIndeterminateMinimumAngle * 2f) % 360f; } - ValueAnimator animator = mIndeterminateSweepAnimator; - if (animator.isRunning()) { - animator.cancel(); + if (mIndeterminateSweepAnimator.isRunning()) { + mIndeterminateSweepAnimator.cancel(); } - animator.start(); + mIndeterminateSweepAnimator.start(); } } }