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

Commit 61eb40d2 authored by Chet Haase's avatar Chet Haase
Browse files

Delay hiding fragments until transition finishes

Change-Id: I616de20e7e161fe1a53cd5e72912cec48f078df5
parent 1b39e221
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -972,9 +972,17 @@ final class FragmentManagerImpl extends FragmentManager {
                        transitionStyle);
                if (anim != null) {
                    anim.setTarget(fragment.mView);
                    // Delay the actual hide operation until the animation finishes, otherwise
                    // the fragment will just immediately disappear
                    final Fragment finalFragment = fragment;
                    anim.addListener(new AnimatorListenerAdapter() {
                        @Override
                        public void onAnimationEnd(Animator animation) {
                            finalFragment.mView.setVisibility(View.GONE);
                        }
                    });
                    anim.start();
                }
                fragment.mView.setVisibility(View.GONE);
            }
            if (fragment.mAdded && fragment.mHasMenu) {
                mNeedMenuInvalidate = true;