Loading core/java/android/app/BackStackRecord.java +5 −2 Original line number Diff line number Diff line Loading @@ -813,8 +813,11 @@ final class BackStackRecord extends FragmentTransaction implements /** * Reverses the execution of the operations within this transaction. The Fragment states will * only be modified if optimizations are not allowed. * * @param moveToState {@code true} if added fragments should be moved to their final state * in unoptimized transactions */ void executePopOps() { void executePopOps(boolean moveToState) { for (int opNum = mOps.size() - 1; opNum >= 0; opNum--) { final Op op = mOps.get(opNum); Fragment f = op.fragment; Loading Loading @@ -860,7 +863,7 @@ final class BackStackRecord extends FragmentTransaction implements mManager.moveFragmentToExpectedState(f); } } if (!mAllowOptimization) { if (!mAllowOptimization && moveToState) { mManager.moveToState(mManager.mCurState, true); } } Loading core/java/android/app/FragmentManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -2170,7 +2170,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate if (isPop) { record.executeOps(); } else { record.executePopOps(); record.executePopOps(false); } // move to the end Loading Loading @@ -2280,7 +2280,10 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate final boolean isPop = isRecordPop.get(i); if (isPop) { record.bumpBackStackNesting(-1); record.executePopOps(); // Only execute the add operations at the end of // all transactions. boolean moveToState = i == (endIndex - 1); record.executePopOps(moveToState); } else { record.bumpBackStackNesting(1); record.executeOps(); Loading Loading
core/java/android/app/BackStackRecord.java +5 −2 Original line number Diff line number Diff line Loading @@ -813,8 +813,11 @@ final class BackStackRecord extends FragmentTransaction implements /** * Reverses the execution of the operations within this transaction. The Fragment states will * only be modified if optimizations are not allowed. * * @param moveToState {@code true} if added fragments should be moved to their final state * in unoptimized transactions */ void executePopOps() { void executePopOps(boolean moveToState) { for (int opNum = mOps.size() - 1; opNum >= 0; opNum--) { final Op op = mOps.get(opNum); Fragment f = op.fragment; Loading Loading @@ -860,7 +863,7 @@ final class BackStackRecord extends FragmentTransaction implements mManager.moveFragmentToExpectedState(f); } } if (!mAllowOptimization) { if (!mAllowOptimization && moveToState) { mManager.moveToState(mManager.mCurState, true); } } Loading
core/java/android/app/FragmentManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -2170,7 +2170,7 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate if (isPop) { record.executeOps(); } else { record.executePopOps(); record.executePopOps(false); } // move to the end Loading Loading @@ -2280,7 +2280,10 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate final boolean isPop = isRecordPop.get(i); if (isPop) { record.bumpBackStackNesting(-1); record.executePopOps(); // Only execute the add operations at the end of // all transactions. boolean moveToState = i == (endIndex - 1); record.executePopOps(moveToState); } else { record.bumpBackStackNesting(1); record.executeOps(); Loading