Skip to content

Commit 1154d3c

Browse files
author
Daniel Pichl
committed
Merge branch 'master' into dev
# Conflicts: # circularprogressindicator/src/main/java/antonkozyriatskyi/circularprogressindicator/CircularProgressIndicator.java
2 parents 7543ac5 + 7ece76a commit 1154d3c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

circularprogressindicator/src/main/java/antonkozyriatskyi/circularprogressindicator/CircularProgressIndicator.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ public class CircularProgressIndicator extends View {
9494

9595
private boolean isFillBackgroundEnabled;
9696

97+
private int animationDuration = DEFAULT_ANIMATION_DURATION;
98+
9799
private boolean isShowTextEnabled = true;
98100

99101
@Direction
@@ -420,7 +422,7 @@ public Double evaluate(float fraction, Double startValue, Double endValue) {
420422
return (startValue + (endValue - startValue) * fraction);
421423
}
422424
}, oldCurrentProgress, progressValue);
423-
progressAnimator.setDuration(DEFAULT_ANIMATION_DURATION);
425+
progressAnimator.setDuration(animationDuration);
424426
progressAnimator.setValues(angleProperty);
425427
progressAnimator.setInterpolator(animationInterpolator);
426428
progressAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@@ -709,6 +711,12 @@ public boolean isShowTextEnabled() {
709711
return isShowTextEnabled;
710712
}
711713

714+
public void setAnimationDuration(int duration) {
715+
animationDuration = duration;
716+
}
717+
718+
public int getAnimationDuration() { return animationDuration; }
719+
712720
public void setInterpolator(@NonNull Interpolator interpolator) {
713721
animationInterpolator = interpolator;
714722
}

0 commit comments

Comments
 (0)