Skip to content

Commit 750bb9b

Browse files
committed
Fix a bug in double-swiping panels...
...that could cause them both to be shown at once. Bug: 7179458 Change-Id: I32e51bd6d4f5773d0f4f5d3e99a84d299cd4b766
1 parent db9a376 commit 750bb9b

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ public boolean onTouch(View v, MotionEvent event) {
295295
}
296296

297297
public void fling(float vel, boolean always) {
298+
if (DEBUG) LOG("fling: vel=%.3f, this=%s", vel, this);
298299
mVel = vel;
299300

300301
if (always||mVel != 0) {
@@ -416,18 +417,21 @@ public void setBar(PanelBar panelBar) {
416417

417418
public void collapse() {
418419
// TODO: abort animation or ongoing touch
420+
if (DEBUG) LOG("collapse: " + this);
419421
if (!isFullyCollapsed()) {
422+
mTimeAnimator.cancel();
423+
mClosing = true;
420424
// collapse() should never be a rubberband, even if an animation is already running
421425
mRubberbanding = false;
422426
fling(-mSelfCollapseVelocityPx, /*always=*/ true);
423427
}
424428
}
425429

426430
public void expand() {
431+
if (DEBUG) LOG("expand: " + this);
427432
if (isFullyCollapsed()) {
428433
mBar.startOpeningPanel(this);
429-
if (DEBUG) LOG("expand: calling fling(%s, true)", mSelfExpandVelocityPx);
430-
fling (mSelfExpandVelocityPx, /*always=*/ true);
434+
fling(mSelfExpandVelocityPx, /*always=*/ true);
431435
} else if (DEBUG) {
432436
if (DEBUG) LOG("skipping expansion: is expanded");
433437
}

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public void onAllPanelsCollapsed() {
149149

150150
@Override
151151
public void onPanelFullyOpened(PanelView openPanel) {
152+
super.onPanelFullyOpened(openPanel);
152153
mFadingPanel = openPanel;
153154
mShouldFade = true; // now you own the fade, mister
154155
}

0 commit comments

Comments
 (0)