Infeasible
Status Update
Comments
jb...@google.com <jb...@google.com>
da...@gmail.com <da...@gmail.com> #2
Oh and one more thing I forgot. Fragment A's child fragment is also part of the nested navigation controller, for which the Fragment A contains the root NavHostFragment, and not the root nav controller Fragment A is part of. So maybe it's not due to FragmentManager, maybe it's the nested navigation controller prematurely removing it's own fragment, when exitAnimation starts for it's root/parent fragment A.
Other than that, instanceState of the child fragment is preserved properly when navigating back and forth.. It's just that it's view is removed prematurely for some reason.
Other than that, instanceState of the child fragment is preserved properly when navigating back and forth.. It's just that it's view is removed prematurely for some reason.
[Deleted User] <[Deleted User]> #3
Ok I just tested it, and it is due to nested navigation graph. When I include a child fragment directly into Fragment A, without navigation, it's not removed prematurely and it's working as intended.
So where do we go from here, is this a bug for you to fix, or there's something wrong with my nested navigation graph implementation, in which case I'd like you to point me in the right direction how to fix it?
So where do we go from here, is this a bug for you to fix, or there's something wrong with my nested navigation graph implementation, in which case I'd like you to point me in the right direction how to fix it?
mu...@hicebank.ru <mu...@hicebank.ru> #4
Can you attach a sample project that reproduces your issue?
wo...@gmail.com <wo...@gmail.com> #5
Here you go: https://drive.google.com/file/d/12Tz8YjCEbcs4LzxqL4352zUJyPvJ_GLt/view?usp=sharing
I slowed down the animations so you can see what's happening.
Root Fragment A is the one with BottomNavigationBar on the bottom.
GREEN - Fragment A's CHILD fragment (the one that's disappearing)
RED - Destination Fragment
Press "Settings" in the action menu on the upper right to start navigation. Observe how Root Fragment A is visible during the whole animation with it's BottomNavigationBar, but it's CHILD GREEN fragment disappears immediately, as it is part of the nested navigation graph hosted in the Fragment A itself.
On the way back, Fragment A is properly recreated with it's green child fragment, and both are visible properly (when going back in the direction A <- B).
I slowed down the animations so you can see what's happening.
Root Fragment A is the one with BottomNavigationBar on the bottom.
GREEN - Fragment A's CHILD fragment (the one that's disappearing)
RED - Destination Fragment
Press "Settings" in the action menu on the upper right to start navigation. Observe how Root Fragment A is visible during the whole animation with it's BottomNavigationBar, but it's CHILD GREEN fragment disappears immediately, as it is part of the nested navigation graph hosted in the Fragment A itself.
On the way back, Fragment A is properly recreated with it's green child fragment, and both are visible properly (when going back in the direction A <- B).
jb...@google.com <jb...@google.com> #6
I'm having trouble downloading your project from Google Drive for some reason. Would you mind attaching it here directly?
I suspect this is a Fragment issue and not something Navigation can control. I'd be interested to know if you run into the same issue if you have *any* Fragment, rather than a NavHostFragment, between your child of A and A itself.
I suspect this is a Fragment issue and not something Navigation can control. I'd be interested to know if you run into the same issue if you have *any* Fragment, rather than a NavHostFragment, between your child of A and A itself.
Description
Version used: 1.2.0-alpha04
Devices/Android versions reproduced on: Pixel 2 XL QP1A.190711.020, Pixel 3 XL QP1A.190711.020.C3
Transitions should be able to specify a z-order in which they are to be played.
When setting Fragment->Fragment transitions via Fragment.set(Enter|Exit|SharedElement|...)Transition(), an exiting transition from FragmentA will be played above (on top of) the entering transition of FragmentB. In some scenarios, such as a fade-through transition, where FragmentA fades out and FragmentB fades in, this is the desired behavior. In other scenarios such as slide transitions, where FragmentA slides down-and-out and FragmentB slides up-and-in, FragmentA's exiting transition should be played below FragmentB's entering transition animation.
Allow for a way for transitions to specify the z-order in which they should be shown.
Attached is a project illustrating the unexpected Fragment->Fragment slide transition behavior as well as two screen recordings.