Closed choristery closed 1 year ago
Hey 👋
Actually I do not understand why I have merged PageCurlConfig
into PageCurlState
🤷
As for (todays) me they could be independent and thus you may create a state
before config
to perform your custom logic in onCustomTap
. I have split them in PR #19, so the new usage would be:
val state = rememberPageCurlState()
val config = rememberPageCurlConfig(
onCustomTap = { size, position ->
// You may access `state` here to flip forward / backward
}
)
PageCurl(
count = ...,
state = state,
config = config,
) { index ->
...
}
Will it solve your case?
Sure, that would be a perfect solution. Thank you for your help.
Awesome, thanks for confirming.
It should be a part of the 1.4.0 release.
"Hi, I've encountered an issue while using this. Since I need to create PageCurlConfig before creating PageCurlState, how can I control flipping forward or backward using PageCurlState in the onCustomTap? I tried using
stateOf
along withLaunchedEffect
to trigger the offset change in onCustomTap, but it causes recomposition. Do you have any suggestions?"