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
}
public void onCollapse() {
- if (mCustomizePanel != null && mCustomizePanel.isCustomizing()) {
+ if (mCustomizePanel != null && mCustomizePanel.isShown()) {
mCustomizePanel.hide(mCustomizePanel.getWidth() / 2, mCustomizePanel.getHeight() / 2);
}
}
}
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;
}
}
+ public boolean isShown() {
+ return isShown;
+ }
+
private void setCustomizing(boolean customizing) {
mCustomizing = customizing;
mQsContainer.notifyCustomizeChanged();
private final AnimatorListener mExpandAnimationListener = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- setCustomizing(true);
+ if (isShown) {
+ setCustomizing(true);
+ }
mNotifQsContainer.setCustomizerAnimating(false);
}