Closed carriehall closed 6 years ago
I'm sorry, but I'm having a little trouble fully understanding your question. Could you provide a use-case/example?
Of course!
We have a single activity app, and now we are using FragNav to switch out the container fragment as you navigate around the app. However, the activity also has a persistent player view above the BottomNavigationView which is there at all times. We've implemented this as a fragment which is added in xml.
What seemed to be happening is that everything is inflated as expected, followed by initialising the FragNav, which then [cleared the fragment manager] (https://github.com/ncapdevi/FragNav/blob/master/frag-nav/src/main/java/com/ncapdevi/fragnav/FragNavController.java#L162)thereby removing the PlayerFragment we had inflated.
We've done a workaround now to ensure that the inflation happens after the FragNav initialise call which looks fine, so I'm happy to close this issue!
https://github.com/ncapdevi/FragNav/blob/master/frag-nav/src/main/java/com/ncapdevi/fragnav/FragNavController.java#L162
It is currently not possible at startup to add a fragment outside of the library, as the library clears the fragment manager during initialisation.
If the app is a single activity app, what is the best approach to add a fragment that should exist outside of the switchable tab area?