Merge pull request #65 from TouchInstinct/feature/default_transition

added ability to override default transition
This commit is contained in:
Gavriil 2017-06-06 19:34:01 +03:00 committed by GitHub
commit 2bf275cd13
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()}.
*