Skip to content

Commit

Permalink
Merge pull request #1 from brookmg/fix/rotation-direction
Browse files Browse the repository at this point in the history
fix: correct `setProgressWithAnimation` function to consider the prog…
  • Loading branch information
brookmg authored Oct 22, 2020
2 parents 471e1c6 + 5c471ea commit 9e2e347
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ class CircularProgressBar(context: Context, attrs: AttributeSet? = null) : View(
* @param startDelay [Long] optional, null by default.
*/
@JvmOverloads
fun setProgressWithAnimation(progress: Float,
fun setProgressWithAnimation(rawProgress: Float,
duration: Long? = null,
interpolator: TimeInterpolator? = null,
startDelay: Long? = null) {
val progress = if (progressDirection.isToRight()) rawProgress * -1 else rawProgress
progressAnimator?.cancel()
progressAnimator = ValueAnimator.ofFloat(if (indeterminateMode) progressIndeterminateMode else this.progress, progress)
duration?.also { progressAnimator?.duration = it }
Expand Down

0 comments on commit 9e2e347

Please sign in to comment.