I have 2 actions
Action1
I ended up overriding onCreateAnimation in the fragment that calls navigate. This exemple shows how to navigate through nested nav graphs by ID and replace the pop exit animation (or popExitAnim) conditionnally.
override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
val navController = findNavController()
val graph = navController.graph.findNode(R.id.onboardingGraph) as NavGraph
val dest = graph.findNode(R.id.confirmationFragment)
if (!enter && dest != null && navController.currentDestination?.id == dest.id) {
return AnimationUtils.loadAnimation(requireContext(), R.anim.slide_out_left)
}
return super.onCreateAnimation(transit, enter, nextAnim)
}
Note that this particular situation is partly due to the directional nature of slide animations.