What is the best way of creating this view:
# compose
b
What is the best way of creating this view:
So a progressbar holder with a gradient progress bar. The bar can also be in the middle, meaning there is empty space on both sides of the gradient instead of just at the end
here is what I have so far:
Copy code
@Composable
fun DualSidedProgress(

) {
    Box(
        modifier = Modifier.fillMaxWidth().height(80.dp)
            .drawBehind
            {
                val radius = CornerRadius(40.dp.toPx())
                drawRoundRect(Color.White, cornerRadius = radius)
                drawRoundRect(
                    Brush.linearGradient(listOf(Color.Black, Color.Red)),
                    topLeft = Offset(40f, 0f),
                    size = this.size.copy(width = this.size.width * .95f),
                    cornerRadius = radius
                )
            }
    ) {
    }
}
final comment it is a static view no animation
k
You can collapse the box and the modifier to a
Canvas
and leave the drawing logic as it is
1