@@ -168,6 +168,7 @@ public class PhoneStatusBar extends BaseStatusBar {
168168 ScrollView mScrollView ;
169169 View mExpandedContents ;
170170 int mNotificationPanelMarginBottomPx , mNotificationPanelMarginLeftPx ;
171+ final Rect mNotificationPanelBackgroundPadding = new Rect ();
171172 int mNotificationPanelGravity ;
172173 int mNotificationPanelMinHeight ;
173174
@@ -270,6 +271,13 @@ public void run() {
270271 }
271272 };
272273
274+ private final Runnable mPerformSelfExpandFling = new Runnable () {
275+ @ Override
276+ public void run () {
277+ performFling (0 , mSelfExpandVelocityPx , true );
278+ }
279+ };
280+
273281 private final Runnable mPerformFling = new Runnable () {
274282 @ Override
275283 public void run () {
@@ -1213,7 +1221,7 @@ public void animateExpand() {
12131221 }
12141222
12151223 prepareTracking (0 , true );
1216- performFling ( 0 , mSelfExpandVelocityPx , true );
1224+ mHandler . post ( mPerformSelfExpandFling );
12171225 }
12181226
12191227 public void animateCollapse () {
@@ -1529,12 +1537,15 @@ boolean interceptTouchEvent(MotionEvent event) {
15291537 mViewDelta = statusBarSize - y ;
15301538 } else {
15311539 mCloseView .getLocationOnScreen (mAbsPos );
1532- mViewDelta = mAbsPos [1 ] + statusBarSize + getCloseViewHeight () - y ; // XXX: not closeViewHeight, but paddingBottom from the 9patch
1540+ mViewDelta = mAbsPos [1 ]
1541+ + getCloseViewHeight () // XXX: not closeViewHeight, but paddingBottom from the 9patch
1542+ + mNotificationPanelBackgroundPadding .top
1543+ + mNotificationPanelBackgroundPadding .bottom
1544+ - y ;
15331545 }
15341546 if ((!mExpanded && y < hitSize ) ||
15351547 // @@ add taps outside the panel if it's not full-screen
15361548 (mExpanded && y > (getExpandedViewMaxHeight ()-hitSize ))) {
1537-
15381549 // We drop events at the edge of the screen to make the windowshade come
15391550 // down by accident less, especially when pushing open a device with a keyboard
15401551 // that rotates (like g1 and droid)
@@ -2287,10 +2298,12 @@ protected void loadDimens() {
22872298 if (mNotificationPanelGravity <= 0 ) {
22882299 mNotificationPanelGravity = Gravity .CENTER_VERTICAL | Gravity .TOP ;
22892300 }
2301+ getNinePatchPadding (res .getDrawable (R .drawable .notification_panel_bg ), mNotificationPanelBackgroundPadding );
22902302 final int notificationPanelDecorationHeight =
22912303 res .getDimensionPixelSize (R .dimen .notification_panel_padding_top )
22922304 + res .getDimensionPixelSize (R .dimen .notification_panel_header_height )
2293- + getNinePatchPadding (res .getDrawable (R .drawable .notification_panel_bg )).bottom ;
2305+ + mNotificationPanelBackgroundPadding .top
2306+ + mNotificationPanelBackgroundPadding .bottom ;
22942307 mNotificationPanelMinHeight =
22952308 notificationPanelDecorationHeight
22962309 + res .getDimensionPixelSize (R .dimen .close_handle_underlap );
@@ -2300,13 +2313,11 @@ protected void loadDimens() {
23002313 if (false ) Slog .v (TAG , "updateResources" );
23012314 }
23022315
2303- private static Rect getNinePatchPadding (Drawable d ) {
2304- Rect padding = new Rect ();
2316+ private static void getNinePatchPadding (Drawable d , Rect outPadding ) {
23052317 if (d instanceof NinePatchDrawable ) {
23062318 NinePatchDrawable ninePatch = (NinePatchDrawable ) d ;
2307- ninePatch .getPadding (padding );
2319+ ninePatch .getPadding (outPadding );
23082320 }
2309- return padding ;
23102321 }
23112322
23122323 //
0 commit comments