diff options
| author | 2012-10-13 15:17:45 -0400 | |
|---|---|---|
| committer | 2012-10-13 17:23:47 -0400 | |
| commit | e111ad300d614a0f94e30f96ae664a1de578c48a (patch) | |
| tree | 361a990f1b5dc1a285185e1134ea335668642da8 | |
| parent | 85341a76677abcccee757f7982b48b3bec2dcf63 (diff) | |
No, that's German for "The Quick Settings, The".
Bug: ???????
Change-Id: I24ffb21b1566d98c9df6db48c4062390757cd8bc
15 files changed, 103 insertions, 42 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_settings_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_settings_normal.png Binary files differnew file mode 100644 index 000000000000..3ed741854b69 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_settings_normal.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_settings_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_settings_pressed.png Binary files differnew file mode 100644 index 000000000000..5e20eea9b655 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_settings_pressed.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_settings_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_settings_normal.png Binary files differnew file mode 100644 index 000000000000..44cfc5bc49d3 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_settings_normal.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_settings_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_settings_pressed.png Binary files differnew file mode 100644 index 000000000000..0c3fdcd32ae9 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_settings_pressed.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_settings_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_settings_normal.png Binary files differnew file mode 100644 index 000000000000..80fdb790891e --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_settings_normal.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_settings_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_settings_pressed.png Binary files differnew file mode 100644 index 000000000000..ac7c1a7f0e73 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_settings_pressed.png diff --git a/packages/SystemUI/res/drawable/ic_notify_settings.xml b/packages/SystemUI/res/drawable/ic_notify_settings.xml new file mode 100644 index 000000000000..6579d8e87ac3 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_notify_settings.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2012 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/ic_notify_settings_pressed" /> + <item + android:drawable="@drawable/ic_notify_settings_normal" /> +</selector> + diff --git a/packages/SystemUI/res/layout/status_bar_expanded_header.xml b/packages/SystemUI/res/layout/status_bar_expanded_header.xml index f1a8d8260087..c9218375182a 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded_header.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded_header.xml @@ -75,14 +75,14 @@ android:layout_width="50dp" android:layout_height="50dp" android:scaleType="center" - android:src="@drawable/ic_notify_quicksettings" + android:src="@drawable/ic_notify_settings" android:contentDescription="@string/accessibility_settings_button" /> <ImageView android:id="@+id/clear_all_button" android:layout_width="50dp" android:layout_height="50dp" - android:layout_marginLeft="18dp" + android:layout_marginLeft="12dp" android:scaleType="center" android:src="@drawable/ic_notify_clear" android:contentDescription="@string/accessibility_clear_all" diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml index 4b895ec9d1ae..07aca6cfbc1c 100644 --- a/packages/SystemUI/res/layout/super_status_bar.xml +++ b/packages/SystemUI/res/layout/super_status_bar.xml @@ -42,20 +42,11 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - <include layout="@layout/quick_settings" + <ViewStub android:id="@+id/quick_settings_stub" + android:layout="@layout/quick_settings" android:layout_width="match_parent" android:layout_height="match_parent" /> </com.android.systemui.statusbar.phone.PanelHolder> - <ViewStub - android:layout="@layout/status_bar_help" - android:id="@+id/status_bar_cling_stub" - android:inflatedId="@+id/status_bar_cling" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_marginTop="@*android:dimen/status_bar_height" - android:visibility="gone" - /> - </com.android.systemui.statusbar.phone.StatusBarWindowView> diff --git a/packages/SystemUI/res/values-sw600dp/config.xml b/packages/SystemUI/res/values-sw600dp/config.xml index 209ad11e14d5..50575d062232 100644 --- a/packages/SystemUI/res/values-sw600dp/config.xml +++ b/packages/SystemUI/res/values-sw600dp/config.xml @@ -20,6 +20,9 @@ <!-- These resources are around just to allow their values to be customized for different hardware and product builds. --> <resources> + <!-- Enable quick settings on tablets --> + <bool name="config_hasSettingsPanel">true</bool> + <!-- The number of columns in the QuickSettings --> <integer name="quick_settings_num_columns">3</integer> diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 942e814d8342..aec9555215bb 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -97,5 +97,7 @@ <integer name="blinds_pop_duration_ms">10</integer> + <!-- Disable quick settings by default --> + <bool name="config_hasSettingsPanel">false</bool> </resources> diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml index 4a732008137a..2cc344630db0 100644 --- a/packages/SystemUI/res/values/ids.xml +++ b/packages/SystemUI/res/values/ids.xml @@ -19,4 +19,5 @@ <item type="id" name="expandable_tag" /> <item type="id" name="user_expanded_tag" /> <item type="id" name="user_lock_tag" /> + <item type="id" name="status_bar_cling_stub" /> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java index 3fd413ad51dd..d0fc340f1391 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java @@ -57,9 +57,9 @@ public class PanelBar extends FrameLayout { mPanelHolder = ph; final int N = ph.getChildCount(); for (int i=0; i<N; i++) { - final PanelView v = (PanelView) ph.getChildAt(i); - if (v != null) { - addPanel(v); + final View v = ph.getChildAt(i); + if (v != null && v instanceof PanelView) { + addPanel((PanelView) v); } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index d68151d86419..75a259840ebf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -188,12 +188,13 @@ public class PhoneStatusBar extends BaseStatusBar { TextView mNotificationPanelDebugText; // settings + boolean mHasSettingsPanel; SettingsPanelView mSettingsPanel; int mSettingsPanelGravity; // top bar View mClearButton; - View mSettingsButton; + ImageView mSettingsButton; // carrier/wifi label private TextView mCarrierLabel; @@ -420,13 +421,25 @@ public class PhoneStatusBar extends BaseStatusBar { mClearButton.setVisibility(View.INVISIBLE); mClearButton.setEnabled(false); mDateView = (DateView)mStatusBarWindow.findViewById(R.id.date); - mSettingsButton = mStatusBarWindow.findViewById(R.id.settings_button); + + mHasSettingsPanel = res.getBoolean(R.bool.config_hasSettingsPanel); + + mSettingsButton = (ImageView) mStatusBarWindow.findViewById(R.id.settings_button); if (mSettingsButton != null) { - if (mStatusBarView.hasFullWidthNotifications()) { - mSettingsButton.setOnClickListener(mSettingsButtonListener); - mSettingsButton.setVisibility(View.VISIBLE); + mSettingsButton.setOnClickListener(mSettingsButtonListener); + if (mHasSettingsPanel) { + if (mStatusBarView.hasFullWidthNotifications()) { + // the settings panel is hiding behind this button + mSettingsButton.setImageResource(R.drawable.ic_notify_quicksettings); + mSettingsButton.setVisibility(View.VISIBLE); + } else { + // there is a settings panel, but it's on the other side of the (large) screen + mSettingsButton.setVisibility(View.GONE); + } } else { - mSettingsButton.setVisibility(View.GONE); + // no settings panel, go straight to settings + mSettingsButton.setVisibility(View.VISIBLE); + mSettingsButton.setImageResource(R.drawable.ic_notify_settings); } } @@ -490,18 +503,31 @@ public class PhoneStatusBar extends BaseStatusBar { }); } - // Quick Settings (WIP) - mSettingsPanel = (SettingsPanelView) mStatusBarWindow.findViewById(R.id.settings_panel); - mSettingsPanel.setBar(mStatusBarView); - mSettingsPanel.setService(this); - mSettingsPanel.setup(mNetworkController, mBluetoothController, mBatteryController, - mLocationController); - mSettingsPanel.setSystemUiVisibility( - View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER | View.STATUS_BAR_DISABLE_SYSTEM_INFO); + // Quick Settings (where available, some restrictions apply) + if (mHasSettingsPanel) { + final View settings_stub + = mStatusBarWindow.findViewById(R.id.quick_settings_stub); - if (!ActivityManager.isHighEndGfx()) { - mSettingsPanel.setBackground(new FastColorDrawable(context.getResources().getColor( - R.color.notification_panel_solid_background))); + if (settings_stub != null) { + mSettingsPanel = (SettingsPanelView) ((ViewStub)settings_stub).inflate(); + } else { + mSettingsPanel = (SettingsPanelView) mStatusBarWindow.findViewById(R.id.settings_panel); + } + + if (mSettingsPanel != null) { + mSettingsPanel.setBar(mStatusBarView); + mSettingsPanel.setService(this); + mSettingsPanel.setup(mNetworkController, mBluetoothController, mBatteryController, + mLocationController); + mSettingsPanel.setSystemUiVisibility( + View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER + | View.STATUS_BAR_DISABLE_SYSTEM_INFO); + + if (!ActivityManager.isHighEndGfx()) { + mSettingsPanel.setBackground(new FastColorDrawable(context.getResources().getColor( + R.color.notification_panel_solid_background))); + } + } } mClingShown = ! (DEBUG_CLINGS @@ -1286,7 +1312,7 @@ public class PhoneStatusBar extends BaseStatusBar { return; } - mSettingsPanel.expand(); + if (mSettingsPanel != null) mSettingsPanel.expand(); if (false) postStartTracing(); } @@ -1596,7 +1622,7 @@ public class PhoneStatusBar extends BaseStatusBar { mCommandQueue.setNavigationIconHints( altBack ? (mNavigationIconHints | StatusBarManager.NAVIGATION_HINT_BACK_ALT) : (mNavigationIconHints & ~StatusBarManager.NAVIGATION_HINT_BACK_ALT)); - mSettingsPanel.setImeWindowStatus(vis > 0); + if (mSettingsPanel != null) mSettingsPanel.setImeWindowStatus(vis > 0); } @Override @@ -1820,10 +1846,12 @@ public class PhoneStatusBar extends BaseStatusBar { lp.leftMargin = mNotificationPanelMarginPx; mNotificationPanel.setLayoutParams(lp); - lp = (FrameLayout.LayoutParams) mSettingsPanel.getLayoutParams(); - lp.gravity = mSettingsPanelGravity; - lp.rightMargin = mNotificationPanelMarginPx; - mSettingsPanel.setLayoutParams(lp); + if (mSettingsPanel != null) { + lp = (FrameLayout.LayoutParams) mSettingsPanel.getLayoutParams(); + lp.gravity = mSettingsPanelGravity; + lp.rightMargin = mNotificationPanelMarginPx; + mSettingsPanel.setLayoutParams(lp); + } updateCarrierLabelVisibility(false); } @@ -1916,7 +1944,19 @@ public class PhoneStatusBar extends BaseStatusBar { private View.OnClickListener mSettingsButtonListener = new View.OnClickListener() { public void onClick(View v) { - animateExpandSettingsPanel(); + if (mHasSettingsPanel) { + animateExpandSettingsPanel(); + } else { + try { + // Dismiss the lock screen when Settings starts. + ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity(); + } catch (RemoteException e) { + } + Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT)); + animateCollapsePanels(); + } } }; @@ -2010,7 +2050,7 @@ public class PhoneStatusBar extends BaseStatusBar { } // Update the QuickSettings container - mSettingsPanel.updateResources(); + if (mSettingsPanel != null) mSettingsPanel.updateResources(); loadDimens(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 96f729ea173d..3c2f0e67d266 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -109,7 +109,8 @@ public class PhoneStatusBarView extends PanelBar { if (mFullWidthNotifications) { // No double swiping. If either panel is open, nothing else can be pulled down. - return (mSettingsPanel.getExpandedHeight() + mNotificationPanel.getExpandedHeight()> 0) + return ((mSettingsPanel == null ? 0 : mSettingsPanel.getExpandedHeight()) + + mNotificationPanel.getExpandedHeight() > 0) ? null : mNotificationPanel; } |