mirror of
https://github.com/fankes/pagecurl-multiplatform.git
synced 2025-09-06 02:35:25 +08:00
Add next / prev animations
This commit is contained in:
@@ -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 = {
|
||||
|
Reference in New Issue
Block a user