Status Update
Comments
il...@google.com <il...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
Description
Version used: 2.3.0
Devices/Android versions reproduced on: samsung s7
The situation is as follows----------
The following animations are set inside the nav Graph:
- EnterAnim: @anim/slide_in_right
- ExitAnim: @anim/stationary
- popEnterAnim: @anim/stationary
- popExitAnim: @anim/slide_out_right
While navigating from fragment A(old) to B(new), "A" is stationary and "B" is nicely drawn on top of "A" while coming in from the right.
After the animation ends, I navigate back. "A" is stationary (nicely drawn behind B) and "B" (drawn on top of A) is moving out to the right. This works fine.
HOWEVER----------
If I press the back button (navigateUp()) while I navigate from "A" to "B" (during the animation from A to B), "B" will be drawn behind "A" while moving out to the right (which isn't intended behavior I think).
I have messed around a bit and noticed that If I only leave ExitAnim empty, everything works. "B" will be drawn on top of "A" even if I "cancel" EnterAnim by pressing the back-button. Of course If I leave ExitAnim empty, "A" isn't visible when "B" slides in from the right.
ATTACHMENTS----------
I have reproduced the problem inside the TrackMySleepQuality App. After pressing Start, Press Stop. The animation will start. Then, Press Back button.
Please let me know how to fix this (or if this is intended behavior?). Thank you for you time.