@@ -134,6 +134,9 @@ public class PhoneStatusBar extends BaseStatusBar {
134134 private float mExpandAccelPx ; // classic value: 2000px/s/s
135135 private float mCollapseAccelPx ; // classic value: 2000px/s/s (will be negated to collapse "up")
136136
137+ private float mFlingGestureMaxOutputVelocityPx ; // how fast can it really go? (should be a little
138+ // faster than mSelfCollapseVelocityPx)
139+
137140 PhoneStatusBarPolicy mIconPolicy ;
138141
139142 // These are no longer handled by the policy, because we need custom strategies for them
@@ -392,12 +395,13 @@ public boolean onTouch(View v, MotionEvent event) {
392395 mTickerView = mStatusBarView .findViewById (R .id .ticker );
393396
394397 mPile = (NotificationRowLayout )mStatusBarWindow .findViewById (R .id .latestItems );
398+ mPile .setLayoutTransitionsEnabled (false );
395399 mPile .setLongPressListener (getNotificationLongClicker ());
396400 if (SHOW_CARRIER_LABEL ) {
397401 mPile .setOnSizeChangedListener (new OnSizeChangedListener () {
398402 @ Override
399403 public void onSizeChanged (View view , int w , int h , int oldw , int oldh ) {
400- updateCarrierLabelVisibility ();
404+ updateCarrierLabelVisibility (false );
401405 }
402406 });
403407 }
@@ -889,7 +893,7 @@ protected void updateNotificationIcons() {
889893 }
890894 }
891895
892- protected void updateCarrierLabelVisibility () {
896+ protected void updateCarrierLabelVisibility (boolean force ) {
893897 if (!SHOW_CARRIER_LABEL ) return ;
894898 // The idea here is to only show the carrier label when there is enough room to see it,
895899 // i.e. when there aren't enough notifications to fill the panel.
@@ -901,7 +905,7 @@ protected void updateCarrierLabelVisibility() {
901905 final boolean makeVisible =
902906 mPile .getHeight () < (mScrollView .getHeight () - mCarrierLabelHeight );
903907
904- if (mCarrierLabelVisible != makeVisible ) {
908+ if (force || mCarrierLabelVisible != makeVisible ) {
905909 mCarrierLabelVisible = makeVisible ;
906910 if (DEBUG ) {
907911 Slog .d (TAG , "making carrier label " + (makeVisible ?"visible" :"invisible" ));
@@ -986,7 +990,7 @@ public void onAnimationEnd(Animator _a) {
986990 .start ();
987991 }
988992
989- updateCarrierLabelVisibility ();
993+ updateCarrierLabelVisibility (false );
990994 }
991995
992996 public void showClock (boolean show ) {
@@ -1159,9 +1163,10 @@ private void makeExpandedVisible(boolean revealAfterDraw) {
11591163 }
11601164
11611165 mExpandedVisible = true ;
1166+ mPile .setLayoutTransitionsEnabled (true );
11621167 makeSlippery (mNavigationBarView , true );
11631168
1164- updateCarrierLabelVisibility ();
1169+ updateCarrierLabelVisibility (true );
11651170
11661171 updateExpandedViewPos (EXPANDED_LEAVE_ALONE );
11671172
@@ -1279,6 +1284,7 @@ void performCollapse() {
12791284 return ;
12801285 }
12811286 mExpandedVisible = false ;
1287+ mPile .setLayoutTransitionsEnabled (false );
12821288 visibilityChanged (false );
12831289 makeSlippery (mNavigationBarView , false );
12841290
@@ -1562,6 +1568,9 @@ boolean interceptTouchEvent(MotionEvent event) {
15621568 }
15631569
15641570 float vel = (float )Math .hypot (yVel , xVel );
1571+ if (vel > mFlingGestureMaxOutputVelocityPx ) {
1572+ vel = mFlingGestureMaxOutputVelocityPx ;
1573+ }
15651574 if (negative ) {
15661575 vel = -vel ;
15671576 }
@@ -2041,7 +2050,7 @@ else if (expandedPosition == EXPANDED_LEAVE_ALONE) {
20412050 mStatusBarWindow .setBackgroundColor (color );
20422051 }
20432052
2044- updateCarrierLabelVisibility ();
2053+ updateCarrierLabelVisibility (false );
20452054 }
20462055
20472056 void updateDisplaySize () {
@@ -2268,6 +2277,8 @@ protected void loadDimens() {
22682277
22692278 mFlingGestureMaxXVelocityPx = res .getDimension (R .dimen .fling_gesture_max_x_velocity );
22702279
2280+ mFlingGestureMaxOutputVelocityPx = res .getDimension (R .dimen .fling_gesture_max_output_velocity );
2281+
22712282 mNotificationPanelMarginBottomPx
22722283 = (int ) res .getDimension (R .dimen .notification_panel_margin_bottom );
22732284 mNotificationPanelMarginLeftPx
0 commit comments