added ability to override default transition

This commit is contained in:
Anton Domnikov 2017-06-06 18:48:21 +03:00
parent 904a12268b
commit 7e17e331de
1 changed files with 10 additions and 1 deletions

View File

@ -147,7 +147,7 @@ public class FragmentNavigation {
.replace(containerViewId, fragment, null)
.addToBackStack(backStackTag);
if (fragmentManager.getBackStackEntryCount() != 0) {
fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
fragmentTransaction.setTransition(getDefaultTransition());
}
if (transactionSetup != null) {
transactionSetup.call(fragmentTransaction).commit();
@ -156,6 +156,15 @@ public class FragmentNavigation {
}
}
/**
* Returns default transition animation.
*
* @return {@link FragmentTransaction#TRANSIT_FRAGMENT_OPEN}.
*/
protected int getDefaultTransition() {
return FragmentTransaction.TRANSIT_FRAGMENT_OPEN;
}
/**
* Simply calls {@link FragmentManager#popBackStack()}.
*