The custom exit animation works for replace
but not for add
getNavFragment()
.childFragmentManager
.beginTransaction()
.setCustomAnimations(
enter,
exit,
popEnter,
popExit
)
.add(R.id.fl_fragment_container, fragment, tag)
.setReorderingAllowed(true)
.apply {
if (shouldAddToBackStack)
addToBackStack(tag)
}
.commit()