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

Commit 7970894a authored by Alan Viverette's avatar Alan Viverette
Browse files

Revert "Fix exit transition and dismiss callback for popup exit transition"

This reverts most of commit 21d36180, which
broke too many expectations in both apps and framework widgets. We need to
find a safer way to handle the exit transition callback.

Bug: 27359366
Bug: 27353218
Change-Id: I769ac7a25cb900c50e857839ca0563fbc5a3cb16
parent 49349717
Loading
Loading
Loading
Loading
+7 −10
Original line number Original line Diff line number Diff line
@@ -1632,7 +1632,6 @@ public class PopupWindow {


        final PopupDecorView decorView = mDecorView;
        final PopupDecorView decorView = mDecorView;
        final View contentView = mContentView;
        final View contentView = mContentView;
        final OnDismissListener dismissListener = mOnDismissListener;


        final ViewGroup contentHolder;
        final ViewGroup contentHolder;
        final ViewParent contentParent = contentView.getParent();
        final ViewParent contentParent = contentView.getParent();
@@ -1676,16 +1675,19 @@ public class PopupWindow {
                    new TransitionListenerAdapter() {
                    new TransitionListenerAdapter() {
                        @Override
                        @Override
                        public void onTransitionEnd(Transition transition) {
                        public void onTransitionEnd(Transition transition) {
                            dismissImmediate(decorView, contentHolder,
                            dismissImmediate(decorView, contentHolder, contentView);
                                    contentView, dismissListener);
                        }
                        }
                    });
                    });
        } else {
        } else {
            dismissImmediate(decorView, contentHolder, contentView, dismissListener);
            dismissImmediate(decorView, contentHolder, contentView);
        }
        }


        // Clears the anchor view.
        // Clears the anchor view.
        unregisterForViewTreeChanges();
        unregisterForViewTreeChanges();

        if (mOnDismissListener != null) {
            mOnDismissListener.onDismiss();
        }
    }
    }


    /**
    /**
@@ -1727,8 +1729,7 @@ public class PopupWindow {
     * Removes the popup from the window manager and tears down the supporting
     * Removes the popup from the window manager and tears down the supporting
     * view hierarchy, if necessary.
     * view hierarchy, if necessary.
     */
     */
    private void dismissImmediate(View decorView, ViewGroup contentHolder,
    private void dismissImmediate(View decorView, ViewGroup contentHolder, View contentView) {
            View contentView, OnDismissListener listener) {
        // If this method gets called and the decor view doesn't have a parent,
        // If this method gets called and the decor view doesn't have a parent,
        // then it was either never added or was already removed. That should
        // then it was either never added or was already removed. That should
        // never happen, but it's worth checking to avoid potential crashes.
        // never happen, but it's worth checking to avoid potential crashes.
@@ -1745,10 +1746,6 @@ public class PopupWindow {
        mDecorView = null;
        mDecorView = null;
        mBackgroundView = null;
        mBackgroundView = null;
        mIsTransitioningToDismiss = false;
        mIsTransitioningToDismiss = false;

        if (mOnDismissListener != null) {
            mOnDismissListener.onDismiss();
        }
    }
    }


    /**
    /**