fragment/src/androidTest/java/androidx/fragment/app/FragmentTransitionTest.java
@Test
    public void invisibleNoTransitions() throws Throwable {
        if (!mReorderingAllowed) {
            return; // only reordered transitions can avoid interaction
        }
        // enter transition
        TransitionFragment fragment = new InvisibleFragment();
        fragment.setLayoutId(R.layout.scene1);
        mFragmentManager.beginTransaction()
                .setReorderingAllowed(mReorderingAllowed)
                .add(R.id.fragmentContainer, fragment)
                .addToBackStack(null)
                .commit();
        FragmentTestUtil.waitForExecution(mActivityRule);
        fragment.waitForNoTransition();
        verifyNoOtherTransitions(fragment);

        // exit transition
        mFragmentManager.beginTransaction()
                .setReorderingAllowed(mReorderingAllowed)
                .remove(fragment)
                .addToBackStack(null)
                .commit();

        fragment.waitForNoTransition();
        verifyNoOtherTransitions(fragment);

        // reenter transition
        FragmentTestUtil.popBackStackImmediate(mActivityRule);
        fragment.waitForNoTransition();
        verifyNoOtherTransitions(fragment);

        // return transition
        FragmentTestUtil.popBackStackImmediate(mActivityRule);
        fragment.waitForNoTransition();
        verifyNoOtherTransitions(fragment);
    }
// Test that invisible fragment views don't participate in transitions
Test that invisible fragment views don't participate in transitions
Test that invisible fragment views don ' t participate in transitions
@Test
    public void invisibleNoTransitions() throws Throwable {
        if (!mReorderingAllowed) {
            return; 
        }
        TransitionFragment fragment = new InvisibleFragment();
        fragment.setLayoutId(R.layout.scene1);
        mFragmentManager.beginTransaction()
                .setReorderingAllowed(mReorderingAllowed)
                .add(R.id.fragmentContainer, fragment)
                .addToBackStack(null)
                .commit();
        FragmentTestUtil.waitForExecution(mActivityRule);
        fragment.waitForNoTransition();
        verifyNoOtherTransitions(fragment);
        mFragmentManager.beginTransaction()
                .setReorderingAllowed(mReorderingAllowed)
                .remove(fragment)
                .addToBackStack(null)
                .commit();
        fragment.waitForNoTransition();
        verifyNoOtherTransitions(fragment);
        FragmentTestUtil.popBackStackImmediate(mActivityRule);
        fragment.waitForNoTransition();
        verifyNoOtherTransitions(fragment);
        FragmentTestUtil.popBackStackImmediate(mActivityRule);
        fragment.waitForNoTransition();
        verifyNoOtherTransitions(fragment);
    }
@ Test public void invisibleNoTransitions ( ) throws Throwable { if ( ! mReorderingAllowed ) { return ; } TransitionFragment fragment = new InvisibleFragment ( ) ; fragment . setLayoutId ( R . layout . scene1 ) ; mFragmentManager . beginTransaction ( ) . setReorderingAllowed ( mReorderingAllowed ) . add ( R . id . fragmentContainer , fragment ) . addToBackStack ( null ) . commit ( ) ; FragmentTestUtil . waitForExecution ( mActivityRule ) ; fragment . waitForNoTransition ( ) ; verifyNoOtherTransitions ( fragment ) ; mFragmentManager . beginTransaction ( ) . setReorderingAllowed ( mReorderingAllowed ) . remove ( fragment ) . addToBackStack ( null ) . commit ( ) ; fragment . waitForNoTransition ( ) ; verifyNoOtherTransitions ( fragment ) ; FragmentTestUtil . popBackStackImmediate ( mActivityRule ) ; fragment . waitForNoTransition ( ) ; verifyNoOtherTransitions ( fragment ) ; FragmentTestUtil . popBackStackImmediate ( mActivityRule ) ; fragment . waitForNoTransition ( ) ; verifyNoOtherTransitions ( fragment ) ; }
Test that invisible fragment views don't participate in transitions
Test that invisible fragment views don ' t participate in transitions
// only reordered transitions can avoid interaction // enter transition // exit transition // reenter transition // return transition