Mahmoud Alim
10/11/2021, 8:50 PMChris Sinco [G]
10/11/2021, 10:23 PMChris Sinco [G]
10/11/2021, 10:23 PMCasey Brooks
10/11/2021, 10:27 PMModifier.clip(shape)
with a Shape (like RoundedCornerShape
) to constrain the ripple to should work.
Box(
Modifier.clip(RoundedCornerShape(4.dp)),
) {
Text(
text = "...",
modifier = Modifier.clickable { }
)
}
I've done this with a custom hexagon shape, and it seems work pretty well.Louis Pullen-Freilich [G]
10/11/2021, 10:48 PMSurface
and pass a shape - it automatically clips like this for youMahmoud Alim
10/12/2021, 9:07 AMMahmoud Alim
10/12/2021, 9:09 AMMahmoud Alim
10/12/2021, 9:10 AM@ExperimentalCoilApi
@Composable
private fun CarTypeItemView(
serviceItem: CarTypeItem,
onSelected: (CarTypeItem) -> Unit
) {
val bgItemColor = bgColor(item = serviceItem)
val roundedCornerShape = RoundedCornerShape(23.dp)
Column(
modifier = Modifier
.clip(roundedCornerShape)
.clickable {
selectedItem = serviceItem
onSelected(serviceItem)
},
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.Start
) {
Row {
Box(
modifier = Modifier
.height(80.dp)
.width(164.dp)
.background(
shape = roundedCornerShape,
color = bgItemColor
),
contentAlignment = Alignment.Center
) {
Row(
....
) {
Column(
Modifier
.weight(.5f),
) {
......
}
Column(
Modifier
.weight(.5f),
) {
.....
}
}
}
}
}
}