From eea317b3c37e1e4cc6f94fe6ea04e74fa7df1f0e Mon Sep 17 00:00:00 2001 From: joeykrim Date: Mon, 6 Jul 2015 10:44:11 -0400 Subject: [PATCH] Adjust upper bound handling If progress is more than 1.0f, rather than subtract 1.0f, we set progress at the upper bound max of 1.0f. Mirroring lower bound handling of setting to the lower bound of 0. Not urgent as Math.min properly handles. --- .../com/pnikosis/materialishprogress/ProgressWheel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/pnikosis/materialishprogress/ProgressWheel.java b/library/src/main/java/com/pnikosis/materialishprogress/ProgressWheel.java index 0c54b4f..79c5819 100644 --- a/library/src/main/java/com/pnikosis/materialishprogress/ProgressWheel.java +++ b/library/src/main/java/com/pnikosis/materialishprogress/ProgressWheel.java @@ -434,9 +434,9 @@ public void setProgress(float progress) { } if (progress > 1.0f) { - progress -= 1.0f; - } else if (progress < 0) { - progress = 0; + progress = 1.0f; + } else if (progress < 0.0f) { + progress = 0.0f; } if (progress == mTargetProgress) {