I don't know if it's new in CMP 1.7.0-alpha01 or i...
# compose
r
I don't know if it's new in CMP 1.7.0-alpha01 or if it was already broken in 1.6, but it looks like if you call
nav.navigateUp()
fast (by clicking a back button before the navigation animation completes), navigation completely breaks. Anyone noticed that?
m
yes same issue
r
I also have a weird behavior when starting and cancelling a back gesture on Android, I think the app restarts with a weird animation
r
No that's different, your problem is that the previous view is "restarted" with a new viewmodel
My problem is that if I hit the back button very fast after opening the view, it does nothing. If I click the back button again I get a white screen.
m
ok sorry my mistake
i
Just note that on Android, CMP redirects to original Google binaries without recompiling or so. So if you have a problem on Android you should report to Google issue tracker.
r
For absolutely every single lib? I thought navigation was a little different in CMP (I never used Jetpack Compose before, I wouldn't know)
i
Navigation does the same
👍 1
p
I think that is a known issue (or behavior) in the navigation component. If you call
pop
with the stack empty it kinda breaks. You can guard against it by checking if it is not empty before calling pop. In your situation you should also debounce the double clicking. Check this video

https://youtu.be/y2zLFONuk7c?feature=shared

Go to the comments section and read the first comment.
navigateUp
wasn't the right solution for this problem either.
i
You shouldn't be "debouncing", but instead preventing clicks if you've already started a transition to another screen - exactly the use case for Lifecycle's `dropUnlessResumed`: https://developer.android.com/jetpack/androidx/releases/lifecycle#2.8.0
👍 3
🆗 1
thank you color 1