fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
void executeOps() {
        final int numOps = mOps.size();
        for (int opNum = 0; opNum < numOps; opNum++) {
            final Op op = mOps.get(opNum);
            final Fragment f = op.fragment;
            if (f != null) {
                f.setNextTransition(mTransition, mTransitionStyle);
            }
            switch (op.cmd) {
                case OP_ADD:
                    f.setNextAnim(op.enterAnim);
                    mManager.addFragment(f, false);
                    break;
                case OP_REMOVE:
                    f.setNextAnim(op.exitAnim);
                    mManager.removeFragment(f);
                    break;
                case OP_HIDE:
                    f.setNextAnim(op.exitAnim);
                    mManager.hideFragment(f);
                    break;
                case OP_SHOW:
                    f.setNextAnim(op.enterAnim);
                    mManager.showFragment(f);
                    break;
                case OP_DETACH:
                    f.setNextAnim(op.exitAnim);
                    mManager.detachFragment(f);
                    break;
                case OP_ATTACH:
                    f.setNextAnim(op.enterAnim);
                    mManager.attachFragment(f);
                    break;
                case OP_SET_PRIMARY_NAV:
                    mManager.setPrimaryNavigationFragment(f);
                    break;
                case OP_UNSET_PRIMARY_NAV:
                    mManager.setPrimaryNavigationFragment(null);
                    break;
                default:
                    throw new IllegalArgumentException("Unknown cmd: " + op.cmd);
            }
            if (!mReorderingAllowed && op.cmd != OP_ADD && f != null) {
                mManager.moveFragmentToExpectedState(f);
            }
        }
        if (!mReorderingAllowed) {
            // Added fragments are added at the end to comply with prior behavior.
            mManager.moveToState(mManager.mCurState, true);
        }
    }
/**
     * Executes the operations contained within this transaction. The Fragment states will only
     * be modified if optimizations are not allowed.
     */
Executes the operations contained within this transaction. The Fragment states will only
be modified if optimizations are not allowed.
Executes the operations contained within this transaction . The Fragment states will only be modified if optimizations are not allowed .
void executeOps() {
        final int numOps = mOps.size();
        for (int opNum = 0; opNum < numOps; opNum++) {
            final Op op = mOps.get(opNum);
            final Fragment f = op.fragment;
            if (f != null) {
                f.setNextTransition(mTransition, mTransitionStyle);
            }
            switch (op.cmd) {
                case OP_ADD:
                    f.setNextAnim(op.enterAnim);
                    mManager.addFragment(f, false);
                    break;
                case OP_REMOVE:
                    f.setNextAnim(op.exitAnim);
                    mManager.removeFragment(f);
                    break;
                case OP_HIDE:
                    f.setNextAnim(op.exitAnim);
                    mManager.hideFragment(f);
                    break;
                case OP_SHOW:
                    f.setNextAnim(op.enterAnim);
                    mManager.showFragment(f);
                    break;
                case OP_DETACH:
                    f.setNextAnim(op.exitAnim);
                    mManager.detachFragment(f);
                    break;
                case OP_ATTACH:
                    f.setNextAnim(op.enterAnim);
                    mManager.attachFragment(f);
                    break;
                case OP_SET_PRIMARY_NAV:
                    mManager.setPrimaryNavigationFragment(f);
                    break;
                case OP_UNSET_PRIMARY_NAV:
                    mManager.setPrimaryNavigationFragment(null);
                    break;
                default:
                    throw new IllegalArgumentException("Unknown cmd: " + op.cmd);
            }
            if (!mReorderingAllowed && op.cmd != OP_ADD && f != null) {
                mManager.moveFragmentToExpectedState(f);
            }
        }
        if (!mReorderingAllowed) {
            mManager.moveToState(mManager.mCurState, true);
        }
    }
void executeOps ( ) { final int numOps = mOps . size ( ) ; for ( int opNum = 0 ; opNum < numOps ; opNum ++ ) { final Op op = mOps . get ( opNum ) ; final Fragment f = op . fragment ; if ( f != null ) { f . setNextTransition ( mTransition , mTransitionStyle ) ; } switch ( op . cmd ) { case OP_ADD : f . setNextAnim ( op . enterAnim ) ; mManager . addFragment ( f , false ) ; break ; case OP_REMOVE : f . setNextAnim ( op . exitAnim ) ; mManager . removeFragment ( f ) ; break ; case OP_HIDE : f . setNextAnim ( op . exitAnim ) ; mManager . hideFragment ( f ) ; break ; case OP_SHOW : f . setNextAnim ( op . enterAnim ) ; mManager . showFragment ( f ) ; break ; case OP_DETACH : f . setNextAnim ( op . exitAnim ) ; mManager . detachFragment ( f ) ; break ; case OP_ATTACH : f . setNextAnim ( op . enterAnim ) ; mManager . attachFragment ( f ) ; break ; case OP_SET_PRIMARY_NAV : mManager . setPrimaryNavigationFragment ( f ) ; break ; case OP_UNSET_PRIMARY_NAV : mManager . setPrimaryNavigationFragment ( null ) ; break ; default : throw new IllegalArgumentException ( "Unknown cmd: " + op . cmd ) ; } if ( ! mReorderingAllowed && op . cmd != OP_ADD && f != null ) { mManager . moveFragmentToExpectedState ( f ) ; } } if ( ! mReorderingAllowed ) { mManager . moveToState ( mManager . mCurState , true ) ; } }
Executes the operations contained within this transaction.
Executes the operations contained within this transaction .
// Added fragments are added at the end to comply with prior behavior.