728x90
.pointerInput(Unit) {
detectDragGestures { change, dragAmount ->
change.consumeAllChanges()
val (x, y) = dragAmount
when {
x > 0 -> { /* right */
println("right")
}
x < 0 -> { /* left */
println("left")
}
}
when {
y > 0 -> { /* down */
bottomSheetVisible.value = false
println("down")
}
y < 0 -> { /* up */
println("up")
}
}
}
}
다음과 같은 코드를 Modifier에 등록해주면 된다.