PreCompose icon indicating copy to clipboard operation
PreCompose copied to clipboard

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

Open LukasAnda opened this issue 1 year ago • 2 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

LukasAnda avatar Mar 17 '24 21:03 LukasAnda

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.

Tlaster avatar Mar 22 '24 09:03 Tlaster

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

VerushkinRoman avatar May 14 '24 07:05 VerushkinRoman