如何在 Jetpack Compose 中设计一个多圆形进度条?

How could I design a multi circular progress bar in jetpack compose?

我正在尝试使用 Jetpack Compose 设计一个显示多进程的进度条,但我没有找到任何库或帮助 material。我只能设计一个进度条,但我需要设计成

.

只需在 Box 中使用多个 CircularProgressIndicator:

Box(contentAlignment = Alignment.Center) {
    CircularProgressIndicator(
        progress = 0.45f,
        color = Red,
        modifier = Modifier.then(Modifier.size(60.dp)))
    CircularProgressIndicator(
        progress = 0.55f,
        color = Green,
        modifier = Modifier.then(Modifier.size(80.dp)))
    CircularProgressIndicator(
        progress = 0.75f,
        color = Blue,
        modifier = Modifier.then(Modifier.size(100.dp)))
}

如果您还想绘制圆形轨道,您可以使用 Canvas + CircularProgressIndicator.
构建自定义可组合项 类似于:

   val stroke = with(LocalDensity.current) {
    Stroke(width = ProgressIndicatorDefaults.StrokeWidth.toPx(), cap = StrokeCap.Butt)
   }

    Canvas(modifier = Modifier.size(60.dp)){
        val diameterOffset = stroke.width / 2
        drawCircle(
            radius = size.minDimension / 2.0f-diameterOffset,
            color= LightGray,style = stroke)
    }
    CircularProgressIndicator(
        progress = 0.45f,
        color = Red,
        modifier = Modifier.then(Modifier.size(60.dp)))