Indeterminate
Omit progress for a continuous, looping animation.
CircularProgressIndicator()
LinearProgressIndicator() Indeterminate and determinate circular & linear progress
Progress indicators express an unspecified wait time (indeterminate) or how far along a known operation is (determinate). Both circular and linear variants are available; pass a progress lambda for the determinate form.
Omit progress for a continuous, looping animation.
CircularProgressIndicator()
LinearProgressIndicator() Animate the progress value and surface it as a percentage.
var target by remember { mutableStateOf(0f) }
val progress by animateFloatAsState(targetValue = target, label = "progress")
LinearProgressIndicator(progress = { progress }, modifier = Modifier.fillMaxWidth())
Text("${(progress * 100).toInt()}%")
Button(onClick = { target = (target + 0.2f).coerceAtMost(1f) }) { Text("Advance") }
OutlinedButton(onClick = { target = 0f }) { Text("Reset") }