Tlaster / PreCompose

Compose Multiplatform Navigation && State Management

Home Page:https://tlaster.github.io/PreCompose/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Back animations sped up + stop working when interrupted in the middle

LukasAnda opened this issue · comments

Describe the bug
When I navigate to another screen and force the animations to be intentionally 3 seconds long, when I press back (on Android), it does not play the animation in the same speed, but only some sped-up version. This issue only happens when using native back button (on emulator for example) and not when calling navigateUp. Also, when I navigate back using system button during this long animation, the whole navigation breaks.

To Reproduce
Steps to reproduce the behavior:

  1. Pull code from here: https://github.com/LukasAnda/Plank-Timer/tree/main
  2. Uncomment animation code in AppNavigation file
  3. Run the Android app.
  4. Navigate to settings and then (while the animation is running) navigate back.
  5. Try to navigate once again to no avail.

Expected behavior
Navigation animations work correctly regardless of if I navigate up using code or system buttons.

Minimal reproducible example
Mentioned in the first step

I am still trying to find the root cause of this.
Another case is that if you try to navigate to another scene while the transition is running, the transition also seems to be incorrect.

If i use androidx.activity.compose.BackHandler in actual android implementation, animation works as expected. But if I replace it with moe.tlaster.precompose.navigation.BackHandler, animation speed up