Ankit Shah
12/08/2021, 11:45 AMnglauber
12/08/2021, 3:22 PMval arcHeight = with(LocalDensity.current) { 30.dp.toPx() }
Box(modifier = Modifier
.size(100.dp, 100.dp)
.background(
color = Color.Red,
shape = object : Shape {
override fun createOutline(
size: Size,
layoutDirection: LayoutDirection,
density: Density
): Outline {
return Outline.Generic(
Path().apply {
moveTo(0f, 0f)
lineTo(0f, size.height - arcHeight)
arcTo(
Rect(
0f,
size.height - arcHeight,
size.width,
size.height
), 180f, -180f, false
)
lineTo(size.width, size.height - arcHeight)
lineTo(size.width, 0f)
close()
}
)
}
}
)
)
Ankit Shah
12/08/2021, 4:25 PM