Add next / prev animations

This commit is contained in:
Oleksandr Balan
2022-06-30 17:32:03 +02:00
parent 973c54f39c
commit 840093c2e7
5 changed files with 265 additions and 162 deletions

View File

@@ -48,14 +48,12 @@ class MainActivity : ComponentActivity() {
modifier = Modifier.overlayControls(
next = {
scope.launch {
val next = (state.current + 1).coerceAtMost(state.max - 1)
state.snapTo(next)
state.next()
}
},
prev = {
scope.launch {
val prev = (state.current - 1).coerceAtLeast(0)
state.snapTo(prev)
state.prev()
}
},
center = {