@@ -43,6 +43,9 @@ public class PhoneStatusBarView extends PanelBar {
4343 private static final String TAG = "PhoneStatusBarView" ;
4444 PhoneStatusBar mBar ;
4545 int mScrimColor ;
46+ float mMinFlingGutter ;
47+ float mNotificationWidth ;
48+ boolean mFullWidthNotifications ;
4649 PanelView mFadingPanel = null ;
4750 PanelView mNotificationPanel , mSettingsPanel ;
4851
@@ -58,6 +61,13 @@ public void setBar(PhoneStatusBar bar) {
5861 public void onAttachedToWindow () {
5962 Resources res = getContext ().getResources ();
6063 mScrimColor = res .getColor (R .color .notification_panel_scrim_color );
64+ mMinFlingGutter = res .getDimension (R .dimen .settings_panel_fling_gutter );
65+ mFullWidthNotifications = false ;
66+ try {
67+ mNotificationWidth = res .getDimension (R .dimen .notification_panel_width );
68+ } catch (Resources .NotFoundException ex ) {
69+ mFullWidthNotifications = true ;
70+ }
6171 }
6272
6373 @ Override
@@ -96,9 +106,12 @@ public PanelView selectPanelForTouchX(float x) {
96106 // right 1/3 for quick settings. If you pull the status bar down a second time you'll
97107 // toggle panels no matter where you pull it down.
98108 final float w = (float ) getMeasuredWidth ();
109+ final float gutter = w - mNotificationWidth ;
110+ final boolean useGutter = !mFullWidthNotifications && gutter > mMinFlingGutter ;
111+ final float threshold = 1.0f - (gutter / w );
99112 final float f = x / w ;
100- if (f > 0.67f && mSettingsPanel .getExpandedFraction () != 1.0f
101- || mNotificationPanel .getExpandedFraction () == 1.0f ) {
113+ if (( useGutter && f > threshold && mSettingsPanel .getExpandedFraction () != 1.0f ) ||
114+ mNotificationPanel .getExpandedFraction () == 1.0f ) {
102115 return mSettingsPanel ;
103116 }
104117 return mNotificationPanel ;
0 commit comments