hi guys, I want to make circular intermediate prog...
# compose
k
hi guys, I want to make circular intermediate progress bar in jetpack compose. I tried some piece of code but it's not working correctly to animate the circle.
Copy code
val strokeWidth = dimensionResource(R.dimen.stroke)
           Box(modifier = Modifier.fillMaxSize()) {
            CircularProgressIndicator(
                progress = .25f,
                modifier = Modifier
                    .align(Alignment.Center)
                    .drawBehind {
                        drawCircle(
                            Cloudy,
                            radius = size.width / 2 - strokeWidth.toPx() / 2,
                            style = Stroke(strokeWidth.toPx())
                        )
                    },
                color = Aqua,
                strokeWidth = strokeWidth
             )
          }
r
Have you tried removing the progress that you've set on the CircularProgressIndicator? That looks like a static value
You can draw it yourself if you'd like something more custom -

https://youtu.be/0mfCbXrYBPE?t=324

this covers how to do an animation by yourself - you'd just want to draw an arc instead of a circle, and rotate that infinitely
k
I really appreciate it. I'll try your suggestion.