fragment/src/main/java/androidx/fragment/app/FragmentTransition.java
private static FragmentTransitionImpl chooseImpl(Fragment outFragment, Fragment inFragment) {
        // Collect all transition instances
        final ArrayList<Object> transitions = new ArrayList<>();
        if (outFragment != null) {
            final Object exitTransition = outFragment.getExitTransition();
            if (exitTransition != null) {
                transitions.add(exitTransition);
            }
            final Object returnTransition = outFragment.getReturnTransition();
            if (returnTransition != null) {
                transitions.add(returnTransition);
            }
            final Object sharedReturnTransition = outFragment.getSharedElementReturnTransition();
            if (sharedReturnTransition != null) {
                transitions.add(sharedReturnTransition);
            }
        }
        if (inFragment != null) {
            final Object enterTransition = inFragment.getEnterTransition();
            if (enterTransition != null) {
                transitions.add(enterTransition);
            }
            final Object reenterTransition = inFragment.getReenterTransition();
            if (reenterTransition != null) {
                transitions.add(reenterTransition);
            }
            final Object sharedEnterTransition = inFragment.getSharedElementEnterTransition();
            if (sharedEnterTransition != null) {
                transitions.add(sharedEnterTransition);
            }
        }
        if (transitions.isEmpty()) {
            return null; // No transition to run
        }
        // Pick the implementation that can handle all the transitions
        if (PLATFORM_IMPL != null && canHandleAll(PLATFORM_IMPL, transitions)) {
            return PLATFORM_IMPL;
        }
        if (SUPPORT_IMPL != null && canHandleAll(SUPPORT_IMPL, transitions)) {
            return SUPPORT_IMPL;
        }
        if (PLATFORM_IMPL != null || SUPPORT_IMPL != null) {
            throw new IllegalArgumentException("Invalid Transition types");
        }
        return null;
    }
/**
     * Chooses the appropriate implementation depending on the Transition instances hold by the
     * Fragments.
     */
Chooses the appropriate implementation depending on the Transition instances hold by the
Fragments.
Chooses the appropriate implementation depending on the Transition instances hold by the Fragments .
private static FragmentTransitionImpl chooseImpl(Fragment outFragment, Fragment inFragment) {
        final ArrayList<Object> transitions = new ArrayList<>();
        if (outFragment != null) {
            final Object exitTransition = outFragment.getExitTransition();
            if (exitTransition != null) {
                transitions.add(exitTransition);
            }
            final Object returnTransition = outFragment.getReturnTransition();
            if (returnTransition != null) {
                transitions.add(returnTransition);
            }
            final Object sharedReturnTransition = outFragment.getSharedElementReturnTransition();
            if (sharedReturnTransition != null) {
                transitions.add(sharedReturnTransition);
            }
        }
        if (inFragment != null) {
            final Object enterTransition = inFragment.getEnterTransition();
            if (enterTransition != null) {
                transitions.add(enterTransition);
            }
            final Object reenterTransition = inFragment.getReenterTransition();
            if (reenterTransition != null) {
                transitions.add(reenterTransition);
            }
            final Object sharedEnterTransition = inFragment.getSharedElementEnterTransition();
            if (sharedEnterTransition != null) {
                transitions.add(sharedEnterTransition);
            }
        }
        if (transitions.isEmpty()) {
            return null; 
        }
        if (PLATFORM_IMPL != null && canHandleAll(PLATFORM_IMPL, transitions)) {
            return PLATFORM_IMPL;
        }
        if (SUPPORT_IMPL != null && canHandleAll(SUPPORT_IMPL, transitions)) {
            return SUPPORT_IMPL;
        }
        if (PLATFORM_IMPL != null || SUPPORT_IMPL != null) {
            throw new IllegalArgumentException("Invalid Transition types");
        }
        return null;
    }
private static FragmentTransitionImpl chooseImpl ( Fragment outFragment , Fragment inFragment ) { final ArrayList < Object > transitions = new ArrayList < > ( ) ; if ( outFragment != null ) { final Object exitTransition = outFragment . getExitTransition ( ) ; if ( exitTransition != null ) { transitions . add ( exitTransition ) ; } final Object returnTransition = outFragment . getReturnTransition ( ) ; if ( returnTransition != null ) { transitions . add ( returnTransition ) ; } final Object sharedReturnTransition = outFragment . getSharedElementReturnTransition ( ) ; if ( sharedReturnTransition != null ) { transitions . add ( sharedReturnTransition ) ; } } if ( inFragment != null ) { final Object enterTransition = inFragment . getEnterTransition ( ) ; if ( enterTransition != null ) { transitions . add ( enterTransition ) ; } final Object reenterTransition = inFragment . getReenterTransition ( ) ; if ( reenterTransition != null ) { transitions . add ( reenterTransition ) ; } final Object sharedEnterTransition = inFragment . getSharedElementEnterTransition ( ) ; if ( sharedEnterTransition != null ) { transitions . add ( sharedEnterTransition ) ; } } if ( transitions . isEmpty ( ) ) { return null ; } if ( PLATFORM_IMPL != null && canHandleAll ( PLATFORM_IMPL , transitions ) ) { return PLATFORM_IMPL ; } if ( SUPPORT_IMPL != null && canHandleAll ( SUPPORT_IMPL , transitions ) ) { return SUPPORT_IMPL ; } if ( PLATFORM_IMPL != null || SUPPORT_IMPL != null ) { throw new IllegalArgumentException ( "Invalid Transition types" ) ; } return null ; }
Chooses the appropriate implementation depending on the Transition instances hold by the
 Fragments.
Chooses the appropriate implementation depending on the Transition instances hold by the Fragments .
// Collect all transition instances // No transition to run // Pick the implementation that can handle all the transitions