am 88c3a511: Merge "Fix a bug in double-swiping panels..." into jb-mr1-dev

* commit '88c3a51123bf39988c33c9074289fddff0e0fec8':
  Fix a bug in double-swiping panels...
This commit is contained in:
Daniel Sandler
2012-10-03 17:00:55 -07:00
committed by Android Git Automerger
2 changed files with 7 additions and 2 deletions

View File

@@ -295,6 +295,7 @@ public class PanelView extends FrameLayout {
} }
public void fling(float vel, boolean always) { public void fling(float vel, boolean always) {
if (DEBUG) LOG("fling: vel=%.3f, this=%s", vel, this);
mVel = vel; mVel = vel;
if (always||mVel != 0) { if (always||mVel != 0) {
@@ -416,7 +417,10 @@ public class PanelView extends FrameLayout {
public void collapse() { public void collapse() {
// TODO: abort animation or ongoing touch // TODO: abort animation or ongoing touch
if (DEBUG) LOG("collapse: " + this);
if (!isFullyCollapsed()) { if (!isFullyCollapsed()) {
mTimeAnimator.cancel();
mClosing = true;
// collapse() should never be a rubberband, even if an animation is already running // collapse() should never be a rubberband, even if an animation is already running
mRubberbanding = false; mRubberbanding = false;
fling(-mSelfCollapseVelocityPx, /*always=*/ true); fling(-mSelfCollapseVelocityPx, /*always=*/ true);
@@ -424,10 +428,10 @@ public class PanelView extends FrameLayout {
} }
public void expand() { public void expand() {
if (DEBUG) LOG("expand: " + this);
if (isFullyCollapsed()) { if (isFullyCollapsed()) {
mBar.startOpeningPanel(this); mBar.startOpeningPanel(this);
if (DEBUG) LOG("expand: calling fling(%s, true)", mSelfExpandVelocityPx); fling(mSelfExpandVelocityPx, /*always=*/ true);
fling (mSelfExpandVelocityPx, /*always=*/ true);
} else if (DEBUG) { } else if (DEBUG) {
if (DEBUG) LOG("skipping expansion: is expanded"); if (DEBUG) LOG("skipping expansion: is expanded");
} }

View File

@@ -149,6 +149,7 @@ public class PhoneStatusBarView extends PanelBar {
@Override @Override
public void onPanelFullyOpened(PanelView openPanel) { public void onPanelFullyOpened(PanelView openPanel) {
super.onPanelFullyOpened(openPanel);
mFadingPanel = openPanel; mFadingPanel = openPanel;
mShouldFade = true; // now you own the fade, mister mShouldFade = true; // now you own the fade, mister
} }