Prashast Rastogi
07/08/2021, 10:35 AM@Composable
fun CircularProgressIndicator(
/@FloatRange(from = 0.0, to = 1.0)/
progress: Float,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colors.primary,
strokeWidth: Dp = ProgressIndicatorDefaults.StrokeWidth
) {
val stroke = with(LocalDensity.current) {
Stroke(width = strokeWidth.toPx(), cap = StrokeCap.Butt)
}
Canvas(
modifier
.progressSemantics(progress)
.size(CircularIndicatorDiameter)
.focusable()
) {
// Start at 12 O'clock
val startAngle = 270f
val sweep = progress * 360f
drawDeterminateCircularIndicator(startAngle, sweep, color, stroke)
}
}
Filip Wiesner
07/08/2021, 10:36 AMCircularProgressIndicator
to have rounded corners 🙂
It shouldn't be too complicatedChris Sinco [G]
07/08/2021, 5:46 PM