Merge change I486fdb55 into eclair
* changes: Fix bug 2183179 - Hitting the back key repeatedly makes the notification shade jump up and down
This commit is contained in:
@@ -140,7 +140,7 @@ public class StatusBarService extends IStatusBar.Stub
|
|||||||
boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
|
boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
|
||||||
switch (event.getKeyCode()) {
|
switch (event.getKeyCode()) {
|
||||||
case KeyEvent.KEYCODE_BACK:
|
case KeyEvent.KEYCODE_BACK:
|
||||||
if (down) {
|
if (!down) {
|
||||||
StatusBarService.this.deactivate();
|
StatusBarService.this.deactivate();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -973,15 +973,24 @@ public class StatusBarService extends IStatusBar.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
void animateCollapse() {
|
void animateCollapse() {
|
||||||
if (SPEW) Log.d(TAG, "Animate collapse: expanded=" + mExpanded
|
if (SPEW) {
|
||||||
+ " expanded visible=" + mExpandedVisible);
|
Log.d(TAG, "animateCollapse(): mExpanded=" + mExpanded
|
||||||
|
+ " mExpandedVisible=" + mExpandedVisible
|
||||||
|
+ " mAnimating=" + mAnimating
|
||||||
|
+ " mAnimVel=" + mAnimVel);
|
||||||
|
}
|
||||||
|
|
||||||
if (!mExpandedVisible) {
|
if (!mExpandedVisible) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareTracking(mDisplay.getHeight()-1);
|
if (mAnimating) {
|
||||||
performFling(mDisplay.getHeight()-1, -2000.0f, true);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int y = mDisplay.getHeight()-1;
|
||||||
|
prepareTracking(y);
|
||||||
|
performFling(y, -2000.0f, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void performExpand() {
|
void performExpand() {
|
||||||
@@ -1096,7 +1105,7 @@ public class StatusBarService extends IStatusBar.Stub
|
|||||||
mTracking = true;
|
mTracking = true;
|
||||||
mVelocityTracker = VelocityTracker.obtain();
|
mVelocityTracker = VelocityTracker.obtain();
|
||||||
boolean opening = !mExpanded;
|
boolean opening = !mExpanded;
|
||||||
if (!mExpanded) {
|
if (opening) {
|
||||||
mAnimAccel = 2000.0f;
|
mAnimAccel = 2000.0f;
|
||||||
mAnimVel = 200;
|
mAnimVel = 200;
|
||||||
mAnimY = mStatusBarView.getHeight();
|
mAnimY = mStatusBarView.getHeight();
|
||||||
@@ -1111,16 +1120,13 @@ public class StatusBarService extends IStatusBar.Stub
|
|||||||
mAnimating = true;
|
mAnimating = true;
|
||||||
mHandler.sendMessageAtTime(mHandler.obtainMessage(MSG_ANIMATE_REVEAL),
|
mHandler.sendMessageAtTime(mHandler.obtainMessage(MSG_ANIMATE_REVEAL),
|
||||||
mCurAnimationTime);
|
mCurAnimationTime);
|
||||||
|
makeExpandedVisible();
|
||||||
} else {
|
} else {
|
||||||
// it's open, close it?
|
// it's open, close it?
|
||||||
if (mAnimating) {
|
if (mAnimating) {
|
||||||
mAnimating = false;
|
mAnimating = false;
|
||||||
mHandler.removeMessages(MSG_ANIMATE);
|
mHandler.removeMessages(MSG_ANIMATE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (opening) {
|
|
||||||
makeExpandedVisible();
|
|
||||||
} else {
|
|
||||||
updateExpandedViewPos(y + mViewDelta);
|
updateExpandedViewPos(y + mViewDelta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1547,7 +1553,7 @@ public class StatusBarService extends IStatusBar.Stub
|
|||||||
|
|
||||||
void updateExpandedViewPos(int expandedPosition) {
|
void updateExpandedViewPos(int expandedPosition) {
|
||||||
if (SPEW) {
|
if (SPEW) {
|
||||||
Log.d(TAG, "updateExpandedViewPos before pos=" + expandedPosition
|
Log.d(TAG, "updateExpandedViewPos before expandedPosition=" + expandedPosition
|
||||||
+ " mTrackingParams.y=" + mTrackingParams.y
|
+ " mTrackingParams.y=" + mTrackingParams.y
|
||||||
+ " mTrackingPosition=" + mTrackingPosition);
|
+ " mTrackingPosition=" + mTrackingPosition);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user