summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2012-05-03 23:16:42 -0400
committerDaniel Sandler <dsandler@android.com>2012-05-07 09:04:53 -0400
commit9ff6378916befd536ddd1816c32a604b068044f4 (patch)
tree331129be45ece755123634ccd067c47b8c5993e4
parent908c7dcf8292aae1067a946f12af88a9677a1878 (diff)
downloadframeworks_base-9ff6378916befd536ddd1816c32a604b068044f4.zip
frameworks_base-9ff6378916befd536ddd1816c32a604b068044f4.tar.gz
frameworks_base-9ff6378916befd536ddd1816c32a604b068044f4.tar.bz2
Visual refresh of notification panel header.
CLOCK - 2 LINE DATE - ROTATION LOCK - SETTINGS ---- CLEAR ALL Bug: 6418617 Change-Id: I477b59d83aaefc6943ed3cfd5bb4e3f4072a8471 Conflicts: packages/SystemUI/res/values/strings.xml
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.pngbin799 -> 577 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.pngbin3167 -> 1106 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.pngbin1024 -> 916 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.pngbin3210 -> 1776 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_off_normal.pngbin0 -> 1628 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_off_pressed.pngbin0 -> 2285 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_on_normal.pngbin0 -> 1697 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_on_pressed.pngbin0 -> 2555 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.pngbin698 -> 546 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.pngbin1732 -> 791 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.pngbin894 -> 739 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.pngbin1908 -> 1116 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_off_normal.pngbin0 -> 1129 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_off_pressed.pngbin0 -> 1406 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_on_normal.pngbin0 -> 1223 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_on_pressed.pngbin0 -> 1565 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.pngbin1138 -> 582 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.pngbin5053 -> 1369 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.pngbin1407 -> 1084 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.pngbin4844 -> 2353 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_off_normal.pngbin0 -> 2225 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_off_pressed.pngbin0 -> 3231 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_on_normal.pngbin0 -> 2366 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_on_pressed.pngbin0 -> 3761 bytes
-rw-r--r--packages/SystemUI/res/drawable/ic_notify_quicksettings.xml8
-rw-r--r--packages/SystemUI/res/drawable/ic_notify_rotation.xml27
-rw-r--r--packages/SystemUI/res/layout/status_bar_expanded.xml49
-rw-r--r--packages/SystemUI/res/values/config.xml3
-rw-r--r--packages/SystemUI/res/values/donottranslate.xml2
-rw-r--r--packages/SystemUI/res/values/strings.xml8
-rw-r--r--packages/SystemUI/res/values/styles.xml15
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/RotationToggle.java30
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java13
33 files changed, 137 insertions, 18 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png
index babddb1..a54761f 100644
--- a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png
index 56cd6f9..f3f336c 100644
--- a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.png
index 23ce001..3ed7418 100644
--- a/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.png
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.png
index d0754a3..5e20eea 100644
--- a/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.png
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_off_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_off_normal.png
new file mode 100644
index 0000000..4ca1ab8
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_off_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_off_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_off_pressed.png
new file mode 100644
index 0000000..85a4cd2
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_off_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_on_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_on_normal.png
new file mode 100644
index 0000000..d0cb087
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_on_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_on_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_on_pressed.png
new file mode 100644
index 0000000..c1c9e16
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_rotation_on_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png
index bf1bad5..b44b527 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png
index 320d92d..94c8165 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.png
index b58e4dc..44cfc5b 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.png
index 604eb75..0c3fdcd 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_off_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_off_normal.png
new file mode 100644
index 0000000..77da014
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_off_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_off_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_off_pressed.png
new file mode 100644
index 0000000..f132d5c
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_off_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_on_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_on_normal.png
new file mode 100644
index 0000000..1637209
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_on_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_on_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_on_pressed.png
new file mode 100644
index 0000000..4d8fbde
--- /dev/null
+++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_rotation_on_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png
index cf9bd8e..870beb4 100644
--- a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png
index 8eee4d9..94a4646 100644
--- a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.png
index 5e67545..80fdb79 100644
--- a/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.png
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.png
index e56aeda..ac7c1a7 100644
--- a/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.png
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_off_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_off_normal.png
new file mode 100644
index 0000000..cebd6d8
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_off_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_off_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_off_pressed.png
new file mode 100644
index 0000000..ef4d9a1
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_off_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_on_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_on_normal.png
new file mode 100644
index 0000000..01146aa
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_on_normal.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_on_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_on_pressed.png
new file mode 100644
index 0000000..e8f01c5
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_rotation_on_pressed.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable/ic_notify_quicksettings.xml b/packages/SystemUI/res/drawable/ic_notify_quicksettings.xml
index b37dc39..d8ea524 100644
--- a/packages/SystemUI/res/drawable/ic_notify_quicksettings.xml
+++ b/packages/SystemUI/res/drawable/ic_notify_quicksettings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
+<!-- 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.
@@ -16,6 +16,8 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
- android:drawable="@drawable/ic_notify_quicksettings_pressed" />
- <item android:drawable="@drawable/ic_notify_quicksettings_normal" />
+ android:drawable="@drawable/ic_notify_quicksettings_pressed" />
+ <item
+ android:drawable="@drawable/ic_notify_quicksettings_normal" />
</selector>
+
diff --git a/packages/SystemUI/res/drawable/ic_notify_rotation.xml b/packages/SystemUI/res/drawable/ic_notify_rotation.xml
new file mode 100644
index 0000000..213af80
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_notify_rotation.xml
@@ -0,0 +1,27 @@
+<?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_checked="true"
+ android:drawable="@drawable/ic_notify_rotation_on_normal" />
+ <item android:state_checked="true" android:state_pressed="true"
+ android:drawable="@drawable/ic_notify_rotation_on_pressed" />
+ <item android:state_pressed="true"
+ android:drawable="@drawable/ic_notify_rotation_off_pressed" />
+ <item
+ android:drawable="@drawable/ic_notify_rotation_off_normal" />
+</selector>
+
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml
index 1de4ab8..8715a99 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded.xml
@@ -38,14 +38,25 @@
android:paddingRight="3dp"
android:background="@drawable/notification_header_bg"
>
- <com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
- android:textAppearance="@style/TextAppearance.StatusBar.Date"
+ <com.android.systemui.statusbar.policy.Clock
+ android:id="@+id/clock"
android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="8dp"
android:singleLine="true"
- android:gravity="center_vertical|left"
- android:paddingLeft="16dp"
+ android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
+ />
+
+ <com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_toRightOf="@id/clock"
+ android:layout_marginLeft="8dp"
+ android:paddingLeft="8dp"
+ android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
/>
<!--
<com.android.systemui.statusbar.phone.CarrierLabel
@@ -62,22 +73,32 @@
/>
-->
- <ImageView android:id="@+id/settings_button"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ <com.android.systemui.statusbar.RotationToggle android:id="@+id/rotation_lock_button"
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:layout_centerVertical="true"
android:layout_toRightOf="@id/date"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
+ android:layout_marginLeft="12dp"
+ android:button="@drawable/ic_notify_rotation"
+ android:contentDescription="@string/accessibility_rotation_lock_off"
+ />
+
+ <ImageView android:id="@+id/settings_button"
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:layout_marginLeft="8dp"
+ android:layout_centerVertical="true"
+ android:layout_toRightOf="@id/rotation_lock_button"
android:src="@drawable/ic_notify_quicksettings"
android:contentDescription="@string/accessibility_settings_button"
/>
<ImageView android:id="@+id/clear_all_button"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:layout_marginLeft="8dp"
+ android:layout_centerVertical="true"
android:layout_alignParentRight="true"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
android:src="@drawable/ic_notify_clear"
android:contentDescription="@string/accessibility_clear_all"
/>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 1f22507..5548445 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -53,5 +53,8 @@
<!-- When true, show 1/2G networks as 3G. -->
<bool name="config_showMin3G">false</bool>
+
+ <!-- Show rotation lock button in phone-style notification panel. -->
+ <bool name="config_showRotationLock">true</bool>
</resources>
diff --git a/packages/SystemUI/res/values/donottranslate.xml b/packages/SystemUI/res/values/donottranslate.xml
index 4ca2116..089a54d 100644
--- a/packages/SystemUI/res/values/donottranslate.xml
+++ b/packages/SystemUI/res/values/donottranslate.xml
@@ -21,6 +21,6 @@
We show both (DOW on one line, then the date) but this can be overridden for locales as
necessary.
-->
- <string name="status_bar_date_formatter">%2$s</string>
+ <string name="status_bar_date_formatter">%1$s\n%2$s</string>
</resources>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index d79ba42..1eb353f 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -377,4 +377,12 @@
<!-- Content text for do-not-disturb mode notification -->
<string name="notifications_off_text">Tap here to turn notifications back on.</string>
+ <!-- Description of the button in the phone-style notification panel that controls auto-rotation, when auto-rotation is on. [CHAR LIMIT=NONE] -->
+ <string name="accessibility_rotation_lock_off">Screen will rotate automatically.</string>
+
+ <!-- Description of the button in the phone-style notification panel that controls auto-rotation, when auto-rotation is off. [CHAR LIMIT=NONE] -->
+ <string name="accessibility_rotation_lock_on_landscape">Screen is locked in landscape orientation.</string>
+
+ <!-- Description of the button in the phone-style notification panel that controls auto-rotation, when auto-rotation is off. [CHAR LIMIT=NONE] -->
+ <string name="accessibility_rotation_lock_on_portrait">Screen is locked in portrait orientation.</string>
</resources>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 02411d4..144760e 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -53,6 +53,21 @@
<item name="android:textColor">@android:color/holo_blue_light</item>
</style>
+ <style name="TextAppearance.StatusBar.Expanded" parent="@*android:style/TextAppearance.StatusBar" />
+
+ <style name="TextAppearance.StatusBar.Expanded.Clock">
+ <item name="android:textSize">32dp</item>
+ <item name="android:textStyle">normal</item>
+ <item name="android:textColor">#ffffff</item>
+ </style>
+
+ <style name="TextAppearance.StatusBar.Expanded.Date">
+ <item name="android:textSize">12dp</item>
+ <item name="android:textStyle">normal</item>
+ <item name="android:textColor">#666666</item>
+ <item name="android:textAllCaps">true</item>
+ </style>
+
<style name="Animation" />
<style name="Animation.ShirtPocketPanel">
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/RotationToggle.java b/packages/SystemUI/src/com/android/systemui/statusbar/RotationToggle.java
new file mode 100644
index 0000000..c5a7354
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/RotationToggle.java
@@ -0,0 +1,30 @@
+package com.android.systemui.statusbar;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.CompoundButton;
+
+import com.android.systemui.statusbar.policy.AutoRotateController;
+
+public class RotationToggle extends CompoundButton {
+ AutoRotateController mRotater;
+
+ public RotationToggle(Context context) {
+ super(context);
+ mRotater = new AutoRotateController(context, this);
+ setClickable(true);
+ }
+
+ public RotationToggle(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ mRotater = new AutoRotateController(context, this);
+ setClickable(true);
+ }
+
+ public RotationToggle(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ mRotater = new AutoRotateController(context, this);
+ setClickable(true);
+ }
+
+}
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 c1d3c57..9777d89 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -63,6 +63,7 @@ import android.view.WindowManagerImpl;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
+import android.widget.CompoundButton;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
@@ -77,8 +78,10 @@ import com.android.systemui.recent.RecentTasksLoader;
import com.android.systemui.statusbar.BaseStatusBar;
import com.android.systemui.statusbar.NotificationData;
import com.android.systemui.statusbar.NotificationData.Entry;
+import com.android.systemui.statusbar.RotationToggle;
import com.android.systemui.statusbar.SignalClusterView;
import com.android.systemui.statusbar.StatusBarIconView;
+import com.android.systemui.statusbar.policy.AutoRotateController;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.DateView;
import com.android.systemui.statusbar.policy.IntruderAlertView;
@@ -169,6 +172,7 @@ public class PhoneStatusBar extends BaseStatusBar {
// top bar
View mClearButton;
View mSettingsButton;
+ RotationToggle mRotationButton;
// drag bar
CloseDragHandle mCloseView;
@@ -299,6 +303,13 @@ public class PhoneStatusBar extends BaseStatusBar {
mStatusBarView = (PhoneStatusBarView) mStatusBarWindow.findViewById(R.id.status_bar);
mNotificationPanel = mStatusBarWindow.findViewById(R.id.notification_panel);
+ // don't allow clicks on the panel to pass through to the background where they will cause the panel to close
+ mNotificationPanel.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ return true;
+ }
+ });
if (ENABLE_INTRUDERS) {
mIntruderAlertView = (IntruderAlertView) View.inflate(context, R.layout.intruder_alert, null);
@@ -344,6 +355,8 @@ public class PhoneStatusBar extends BaseStatusBar {
mDateView = (DateView)mStatusBarWindow.findViewById(R.id.date);
mSettingsButton = mStatusBarWindow.findViewById(R.id.settings_button);
mSettingsButton.setOnClickListener(mSettingsButtonListener);
+ mRotationButton = (RotationToggle) mStatusBarWindow.findViewById(R.id.rotation_lock_button);
+
mScrollView = (ScrollView)mStatusBarWindow.findViewById(R.id.scroll);
mScrollView.setVerticalScrollBarEnabled(false); // less drawing during pulldowns