mattinger
01/05/2022, 12:10 AMmattinger
01/05/2022, 12:11 AMmattinger
01/05/2022, 12:12 AM// Take the given constraints, and make sure we maintain an aspect
// ratio of 1:1, and add a bit of internal padding to account for the
// stroke being drawn so that everything fits entirely within the box
BoxWithConstraints(
modifier = modifier
.aspectRatio(1f),
contentAlignment = Alignment.Center
) {
Canvas(modifier = Modifier.size(constraints.maxWidth.dp, constraints.maxHeight.dp)) {
drawArc(
color = ringBackgroundColor,
startAngle = 0f,
sweepAngle = 360f,
useCenter = false,
style = Stroke(width = RING_STROKE_WIDTH.toPx(), cap = StrokeCap.Round)
)
}
}
mattinger
01/05/2022, 12:14 AMKirill Grouchnikov
01/05/2022, 12:25 AMmattinger
01/05/2022, 12:43 AMtad
01/05/2022, 5:40 AMtad
01/05/2022, 5:44 AM