I have created a custom button that makes animations when you start clicking and when you release the click. This works, but I have a LazyVerticalGrid with several buttons and this animation only works on some.
我已经创建了一个自定义按钮,当你开始点击和释放点击时,它会制作动画。这是可行的,但我有一个带有几个按钮的LazyVerticalGrid,这个动画只在一些按钮上起作用。
.pointerInput(isPressed) {
awaitPointerEventScope {
isPressed = if (isPressed) {
waitForUpOrCancellation()
false
} else {
awaitFirstDown(false)
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
true
}
}
}
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!