Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ceb116d authored by George Mount's avatar George Mount
Browse files

Fix problem with empty AnimatorSet during fragment removal.

Bug: 65354043

When an empty AnimatorSet is used in a fragment animation,
it can end immediately. This CL properly detects this
case and handles it properly.

Test: manual, ran fragment CTS
Change-Id: I63bee3818106f9c8e86cdc94af61d6bc8407c789
parent 27616138
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1380,8 +1380,13 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                                    @Override
                                    public void onAnimationEnd(Animator anim) {
                                        container.endViewTransition(view);
                                        if (fragment.getAnimatingAway() != null) {
                                            fragment.setAnimatingAway(null);
                                        Animator animator = f.getAnimatingAway();
                                        f.setAnimatingAway(null);
                                        // If the animation finished immediately, the fragment's
                                        // view will still be there. If so, we can just pretend
                                        // there was no animation and skip the moveToState()
                                        if (container.indexOfChild(view) == -1
                                                && animator != null) {
                                            moveToState(fragment, fragment.getStateAfterAnimating(),
                                                    0, 0, false);
                                        }