I observe the strange behavior of the fragments. There are three fragments: A, B and C. Add A to activate. Inside A, create B and add it to A via childFragmentManager in A.onViewCreated. Then, by user action, we start the animation, which replaces fragment A with activation on fragment C. When you launch this transaction, B disappears first from a, and then the animation starts with what remains in A.
It looks like when you try to detach And first, all child fragments are detached, and only then the transaction starts. But! If B was not created programmatically, but described in layout A, then there is no such problem. A disappears along with B, as it should be
GitLab problem example: https://gitlab.com/restangel1993/fragmentinfragment
add or replace in a transaction — it doesn't matter, the problem remains. Like animation - I tried to give custom animations, use FramentTransition
The question arises: what is the difference between a fragment created programmatically and added through a transaction from a fragment created during an xml inflation? How not to let the B unhook from A ahead of time and screw up the animation?