Merge "[phones] Only allow double-flick opening of the quicksettings panel." into jb-mr1-dev
This commit is contained in:
@@ -164,6 +164,9 @@
|
|||||||
<integer name="notification_panel_layout_gravity">0x37</integer>
|
<integer name="notification_panel_layout_gravity">0x37</integer>
|
||||||
<integer name="settings_panel_layout_gravity">0x37</integer>
|
<integer name="settings_panel_layout_gravity">0x37</integer>
|
||||||
|
|
||||||
|
<!-- Quick settings panels minimum fling open target width. -->
|
||||||
|
<dimen name="settings_panel_fling_gutter">90dp</dimen>
|
||||||
|
|
||||||
<!-- Height of the carrier/wifi name label -->
|
<!-- Height of the carrier/wifi name label -->
|
||||||
<dimen name="carrier_label_height">24dp</dimen>
|
<dimen name="carrier_label_height">24dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
private static final String TAG = "PhoneStatusBarView";
|
private static final String TAG = "PhoneStatusBarView";
|
||||||
PhoneStatusBar mBar;
|
PhoneStatusBar mBar;
|
||||||
int mScrimColor;
|
int mScrimColor;
|
||||||
|
float mMinFlingGutter;
|
||||||
|
float mNotificationWidth;
|
||||||
|
boolean mFullWidthNotifications;
|
||||||
PanelView mFadingPanel = null;
|
PanelView mFadingPanel = null;
|
||||||
PanelView mNotificationPanel, mSettingsPanel;
|
PanelView mNotificationPanel, mSettingsPanel;
|
||||||
|
|
||||||
@@ -58,6 +61,13 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
public void onAttachedToWindow() {
|
public void onAttachedToWindow() {
|
||||||
Resources res = getContext().getResources();
|
Resources res = getContext().getResources();
|
||||||
mScrimColor = res.getColor(R.color.notification_panel_scrim_color);
|
mScrimColor = res.getColor(R.color.notification_panel_scrim_color);
|
||||||
|
mMinFlingGutter = res.getDimension(R.dimen.settings_panel_fling_gutter);
|
||||||
|
mFullWidthNotifications = false;
|
||||||
|
try {
|
||||||
|
mNotificationWidth = res.getDimension(R.dimen.notification_panel_width);
|
||||||
|
} catch (Resources.NotFoundException ex) {
|
||||||
|
mFullWidthNotifications = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -96,9 +106,12 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
// right 1/3 for quick settings. If you pull the status bar down a second time you'll
|
// right 1/3 for quick settings. If you pull the status bar down a second time you'll
|
||||||
// toggle panels no matter where you pull it down.
|
// toggle panels no matter where you pull it down.
|
||||||
final float w = (float) getMeasuredWidth();
|
final float w = (float) getMeasuredWidth();
|
||||||
|
final float gutter = w - mNotificationWidth;
|
||||||
|
final boolean useGutter = !mFullWidthNotifications && gutter > mMinFlingGutter;
|
||||||
|
final float threshold = 1.0f - (gutter / w);
|
||||||
final float f = x / w;
|
final float f = x / w;
|
||||||
if (f > 0.67f && mSettingsPanel.getExpandedFraction() != 1.0f
|
if ((useGutter && f > threshold && mSettingsPanel.getExpandedFraction() != 1.0f) ||
|
||||||
|| mNotificationPanel.getExpandedFraction() == 1.0f) {
|
mNotificationPanel.getExpandedFraction() == 1.0f) {
|
||||||
return mSettingsPanel;
|
return mSettingsPanel;
|
||||||
}
|
}
|
||||||
return mNotificationPanel;
|
return mNotificationPanel;
|
||||||
|
|||||||
Reference in New Issue
Block a user