added ability to override default transition
This commit is contained in:
parent
904a12268b
commit
7e17e331de
|
|
@ -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()}.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue