Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Indeterminate mode #18

Open
whalemare opened this issue Dec 18, 2018 · 0 comments
Open

Indeterminate mode #18

whalemare opened this issue Dec 18, 2018 · 0 comments

Comments

@whalemare
Copy link

Please, add indeterminate mode to your progress bar implementation.
For now this behavior can be done like this:

fun CircularProgressIndicator.indeterminate(durationAnimation: Long = 3000L) {
    ValueAnimator.ofInt(0, 360).apply {
        addUpdateListener {
            val value = it.animatedValue as Int
            startAngle = value
        }
        duration = durationAnimation / 2
        repeatMode = ValueAnimator.REVERSE
        repeatCount = ValueAnimator.INFINITE
    }.start()

    setProgress(0.0, 100.0)
    ValueAnimator.ofFloat(0f, 85f).apply {
        addUpdateListener {
            val value = it.animatedValue as Float
            setCurrentProgress(value.toDouble())
        }
        duration = durationAnimation
        repeatMode = ValueAnimator.REVERSE
        repeatCount = ValueAnimator.INFINITE
    }.start()
}

maybe it be helpfull for something

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant