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

Commit e8dba660 authored by Yoshinori Hirano's avatar Yoshinori Hirano Committed by Steve Kondik
Browse files

Hide QS customizer correctly

When users open and close QS customizer quickly, QSCustomizer#hide()
is not called because QSCustomizer#isCustomizing() returns false.
The isCustomizing() becomes true when the expand animation ends.
The hide() should be called even though the animation is ongoing.

Bug: 30545089
Test: manual - open and close QS customizer quickly

Change-Id: Ic483addfb6ae9da31c997fec7778e5acd718c353
parent 6d76430b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
    }

    public void onCollapse() {
        if (mCustomizePanel != null && mCustomizePanel.isCustomizing()) {
        if (mCustomizePanel != null && mCustomizePanel.isShown()) {
            mCustomizePanel.hide(mCustomizePanel.getWidth() / 2, mCustomizePanel.getHeight() / 2);
        }
    }
@@ -400,7 +400,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
    }

    public void closeDetail() {
        if (mCustomizePanel != null && mCustomizePanel.isCustomizing()) {
        if (mCustomizePanel != null && mCustomizePanel.isShown()) {
            // Treat this as a detail panel for now, to make things easy.
            mCustomizePanel.hide(mCustomizePanel.getWidth() / 2, mCustomizePanel.getHeight() / 2);
            return;
+7 −1
Original line number Diff line number Diff line
@@ -162,6 +162,10 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
        }
    }

    public boolean isShown() {
        return isShown;
    }

    private void setCustomizing(boolean customizing) {
        mCustomizing = customizing;
        mQsContainer.notifyCustomizeChanged();
@@ -216,7 +220,9 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene
    private final AnimatorListener mExpandAnimationListener = new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            if (isShown) {
                setCustomizing(true);
            }
            mNotifQsContainer.setCustomizerAnimating(false);
        }