fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
void executePopOps(boolean moveToState) {
        for (int opNum = mOps.size() - 1; opNum >= 0; opNum--) {
            final Op op = mOps.get(opNum);
            Fragment f = op.fragment;
            if (f != null) {
                f.setNextTransition(FragmentManagerImpl.reverseTransit(mTransition),
                        mTransitionStyle);
            }
            switch (op.cmd) {
                case OP_ADD:
                    f.setNextAnim(op.popExitAnim);
                    mManager.removeFragment(f);
                    break;
                case OP_REMOVE:
                    f.setNextAnim(op.popEnterAnim);
                    mManager.addFragment(f, false);
                    break;
                case OP_HIDE:
                    f.setNextAnim(op.popEnterAnim);
                    mManager.showFragment(f);
                    break;
                case OP_SHOW:
                    f.setNextAnim(op.popExitAnim);
                    mManager.hideFragment(f);
                    break;
                case OP_DETACH:
                    f.setNextAnim(op.popEnterAnim);
                    mManager.attachFragment(f);
                    break;
                case OP_ATTACH:
                    f.setNextAnim(op.popExitAnim);
                    mManager.detachFragment(f);
                    break;
                case OP_SET_PRIMARY_NAV:
                    mManager.setPrimaryNavigationFragment(null);
                    break;
                case OP_UNSET_PRIMARY_NAV:
                    mManager.setPrimaryNavigationFragment(f);
                    break;
                default:
                    throw new IllegalArgumentException("Unknown cmd: " + op.cmd);
            }
            if (!mReorderingAllowed && op.cmd != OP_REMOVE && f != null) {
                mManager.moveFragmentToExpectedState(f);
            }
        }
        if (!mReorderingAllowed && moveToState) {
            mManager.moveToState(mManager.mCurState, true);
        }
    }
/**
     * Reverses the execution of the operations within this transaction. The Fragment states will
     * only be modified if reordering is not allowed.
     *
     * @param moveToState {@code true} if added fragments should be moved to their final state
     *                    in ordered transactions
     */
Reverses the execution of the operations within this transaction. The Fragment states will
only be modified if reordering is not allowed.

@param moveToState  true if added fragments should be moved to their final state
in ordered transactions
Reverses the execution of the operations within this transaction . The Fragment states will only be modified if reordering is not allowed . @param moveToState true if added fragments should be moved to their final state in ordered transactions
void executePopOps(boolean moveToState) {
        for (int opNum = mOps.size() - 1; opNum >= 0; opNum--) {
            final Op op = mOps.get(opNum);
            Fragment f = op.fragment;
            if (f != null) {
                f.setNextTransition(FragmentManagerImpl.reverseTransit(mTransition),
                        mTransitionStyle);
            }
            switch (op.cmd) {
                case OP_ADD:
                    f.setNextAnim(op.popExitAnim);
                    mManager.removeFragment(f);
                    break;
                case OP_REMOVE:
                    f.setNextAnim(op.popEnterAnim);
                    mManager.addFragment(f, false);
                    break;
                case OP_HIDE:
                    f.setNextAnim(op.popEnterAnim);
                    mManager.showFragment(f);
                    break;
                case OP_SHOW:
                    f.setNextAnim(op.popExitAnim);
                    mManager.hideFragment(f);
                    break;
                case OP_DETACH:
                    f.setNextAnim(op.popEnterAnim);
                    mManager.attachFragment(f);
                    break;
                case OP_ATTACH:
                    f.setNextAnim(op.popExitAnim);
                    mManager.detachFragment(f);
                    break;
                case OP_SET_PRIMARY_NAV:
                    mManager.setPrimaryNavigationFragment(null);
                    break;
                case OP_UNSET_PRIMARY_NAV:
                    mManager.setPrimaryNavigationFragment(f);
                    break;
                default:
                    throw new IllegalArgumentException("Unknown cmd: " + op.cmd);
            }
            if (!mReorderingAllowed && op.cmd != OP_REMOVE && f != null) {
                mManager.moveFragmentToExpectedState(f);
            }
        }
        if (!mReorderingAllowed && moveToState) {
            mManager.moveToState(mManager.mCurState, true);
        }
    }
void executePopOps ( boolean moveToState ) { for ( int opNum = mOps . size ( ) - 1 ; opNum >= 0 ; opNum -- ) { final Op op = mOps . get ( opNum ) ; Fragment f = op . fragment ; if ( f != null ) { f . setNextTransition ( FragmentManagerImpl . reverseTransit ( mTransition ) , mTransitionStyle ) ; } switch ( op . cmd ) { case OP_ADD : f . setNextAnim ( op . popExitAnim ) ; mManager . removeFragment ( f ) ; break ; case OP_REMOVE : f . setNextAnim ( op . popEnterAnim ) ; mManager . addFragment ( f , false ) ; break ; case OP_HIDE : f . setNextAnim ( op . popEnterAnim ) ; mManager . showFragment ( f ) ; break ; case OP_SHOW : f . setNextAnim ( op . popExitAnim ) ; mManager . hideFragment ( f ) ; break ; case OP_DETACH : f . setNextAnim ( op . popEnterAnim ) ; mManager . attachFragment ( f ) ; break ; case OP_ATTACH : f . setNextAnim ( op . popExitAnim ) ; mManager . detachFragment ( f ) ; break ; case OP_SET_PRIMARY_NAV : mManager . setPrimaryNavigationFragment ( null ) ; break ; case OP_UNSET_PRIMARY_NAV : mManager . setPrimaryNavigationFragment ( f ) ; break ; default : throw new IllegalArgumentException ( "Unknown cmd: " + op . cmd ) ; } if ( ! mReorderingAllowed && op . cmd != OP_REMOVE && f != null ) { mManager . moveFragmentToExpectedState ( f ) ; } } if ( ! mReorderingAllowed && moveToState ) { mManager . moveToState ( mManager . mCurState , true ) ; } }
Reverses the execution of the operations within this transaction.
Reverses the execution of the operations within this transaction .