'Wrong animation when using popUpTo in Android

I'm doing a nav graph in an Android project where I have a number of fragments - let's just assume for now that I have 3 (fragment A, B and C). I have navigation actions between the fragment like this: A -> B, B -> C, and finially a global action always just pointing to A (Since the app is way bigger than 3 fragments and fragment A is a start screen, so it makes sense to have a global action going back to the start screen). From fragment C I can go back to A with the global action (which is also using popUpTo and Inclusive, to clear the backstack totally).

Now the issue - I'm using transition animations when transitioning between the fragments and they work - except for the global action where I'm using popUpTo. I wish to use a from_left and to_right animation as enter/exit, which works exactly as intended on other fragments, but for the global action the exit animation is wrong (looks kinda like the fragment is moving out to the left of the screen instead of out to the right).

The weird thing is: If I set the popUpTo behaviour to "none", it works perfectly fine, animation plays as intended.

So, is there something one should be aware of about transition animations when using popUpTo in the nav graph?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source