在这个答案中,我得到了错误的波纹动画。你知道如何使用 Jetpack Compose 创建带圆角的波纹吗?
使用默认波纹我有这个:
代码:
Card(shape = RoundedCornerShape(30.dp),
border = BorderStroke(width = 2.dp, color = buttonColor(LocalContext.current)),
backgroundColor = backColor(LocalContext.current),
modifier = Modifier
.fillMaxWidth()
.padding(10.dp)
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = rememberRipple(radius = 30.dp)
) { show = !show }
) { ... } //Show is animation of other element.
//如果我将波纹半径设置为 200 dp(这是卡片的高度)波纹工作不正常。