Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
This commit is contained in:
@@ -54,7 +54,6 @@ public class FragmentStack {
|
||||
mActivity = activity;
|
||||
mFragmentManager = activity.getSupportFragmentManager();
|
||||
mContainerId = containerId;
|
||||
mFragmentTransaction = mFragmentManager.beginTransaction();
|
||||
}
|
||||
|
||||
public void push( Fragment fragment, String tag ) {
|
||||
@@ -65,6 +64,9 @@ public class FragmentStack {
|
||||
Logger.w( TAG, "fragment has already in stack." );
|
||||
return;
|
||||
}
|
||||
|
||||
mFragmentTransaction = mFragmentManager.beginTransaction();
|
||||
|
||||
if ( mCurrentFragment != null ) {
|
||||
mFragmentTransaction.hide( mCurrentFragment );
|
||||
}
|
||||
@@ -80,25 +82,27 @@ public class FragmentStack {
|
||||
}
|
||||
|
||||
public void pop() {
|
||||
if ( mFragmentStack.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
mFragmentTransaction = mFragmentManager.beginTransaction();
|
||||
|
||||
mCurrentFragment = mFragmentStack.pop();
|
||||
if ( mCurrentFragment != null ) {
|
||||
mFragmentTransaction.remove( mCurrentFragment );
|
||||
}
|
||||
if ( mFragmentStack.isEmpty() ) {
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
mCurrentFragment = null;
|
||||
} else {
|
||||
mFragmentStack.pop();
|
||||
if ( !mFragmentStack.isEmpty() ) {
|
||||
Fragment fragment = mFragmentStack.peek();
|
||||
if ( fragment != null ) {
|
||||
mFragmentTransaction.show( fragment );
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
}
|
||||
mCurrentFragment = fragment;
|
||||
} else {
|
||||
mCurrentFragment = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
Fragment fragment = mFragmentStack.peek();
|
||||
if ( fragment != null ) {
|
||||
mFragmentTransaction.show( fragment );
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
}
|
||||
mCurrentFragment = fragment;
|
||||
|
||||
if ( getFragmentStackTransactionListener() != null ) {
|
||||
getFragmentStackTransactionListener().onTransaction();
|
||||
|
||||
Reference in New Issue
Block a user