diff options
author | Daniel Sandler <dsandler@android.com> | 2012-05-09 07:42:48 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-09 07:42:48 -0700 |
commit | 2f4b10e2d4320db490b03eb198ce034302ef00fc (patch) | |
tree | d87d2a00130078ca049946655df385ca20c03a8f | |
parent | 4530d95cc9dee50ffdaed08900410ba1da0ea10e (diff) | |
parent | fc753d2dfa6f1bfafce59e1a2049e640b1629a83 (diff) | |
download | frameworks_base-2f4b10e2d4320db490b03eb198ce034302ef00fc.zip frameworks_base-2f4b10e2d4320db490b03eb198ce034302ef00fc.tar.gz frameworks_base-2f4b10e2d4320db490b03eb198ce034302ef00fc.tar.bz2 |
Merge "More visual refresh in the phone notification panel." into jb-dev
23 files changed, 93 insertions, 135 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-hdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..8a0a30f --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-hdpi/status_bar_close_off.9.png b/packages/SystemUI/res/drawable-hdpi/status_bar_close_off.9.png Binary files differnew file mode 100644 index 0000000..bc6462b --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/status_bar_close_off.9.png diff --git a/packages/SystemUI/res/drawable-hdpi/status_bar_close_on.9.png b/packages/SystemUI/res/drawable-hdpi/status_bar_close_on.9.png Binary files differindex 69f3543..f4e28ae 100644 --- a/packages/SystemUI/res/drawable-hdpi/status_bar_close_on.9.png +++ b/packages/SystemUI/res/drawable-hdpi/status_bar_close_on.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-mdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..25f15e6 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_close_off.9.png b/packages/SystemUI/res/drawable-mdpi/status_bar_close_off.9.png Binary files differnew file mode 100644 index 0000000..4f5bba5 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/status_bar_close_off.9.png diff --git a/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png b/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png Binary files differindex fb30982..ef7afb8 100644 --- a/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png +++ b/packages/SystemUI/res/drawable-mdpi/status_bar_close_on.9.png diff --git a/packages/SystemUI/res/drawable-sw600dp-hdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw600dp-hdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..2ff93d3 --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-hdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-sw600dp-mdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw600dp-mdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..430f913 --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-mdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-sw600dp-xhdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw600dp-xhdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..807241a --- /dev/null +++ b/packages/SystemUI/res/drawable-sw600dp-xhdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-sw720dp-hdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw720dp-hdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..2ff93d3 --- /dev/null +++ b/packages/SystemUI/res/drawable-sw720dp-hdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-sw720dp-mdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw720dp-mdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..430f913 --- /dev/null +++ b/packages/SystemUI/res/drawable-sw720dp-mdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-sw720dp-xhdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-sw720dp-xhdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..807241a --- /dev/null +++ b/packages/SystemUI/res/drawable-sw720dp-xhdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-xhdpi/notification_panel_bg.9.png b/packages/SystemUI/res/drawable-xhdpi/notification_panel_bg.9.png Binary files differnew file mode 100644 index 0000000..60e7418 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/notification_panel_bg.9.png diff --git a/packages/SystemUI/res/drawable-xhdpi/status_bar_close_off.9.png b/packages/SystemUI/res/drawable-xhdpi/status_bar_close_off.9.png Binary files differnew file mode 100644 index 0000000..e243e50 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/status_bar_close_off.9.png diff --git a/packages/SystemUI/res/drawable-xhdpi/status_bar_close_on.9.png b/packages/SystemUI/res/drawable-xhdpi/status_bar_close_on.9.png Binary files differindex fe2c642..cdad949 100644 --- a/packages/SystemUI/res/drawable-xhdpi/status_bar_close_on.9.png +++ b/packages/SystemUI/res/drawable-xhdpi/status_bar_close_on.9.png diff --git a/packages/SystemUI/res/drawable/ic_notify_rotation.xml b/packages/SystemUI/res/drawable/ic_notify_rotation.xml index 213af80..11bc22c 100644 --- a/packages/SystemUI/res/drawable/ic_notify_rotation.xml +++ b/packages/SystemUI/res/drawable/ic_notify_rotation.xml @@ -14,14 +14,23 @@ 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 xmlns:android="http://schemas.android.com/apk/res/android" + android:constantSize="true"> + <item android:state_checked="true" android:state_pressed="true"> + <bitmap android:src="@drawable/ic_notify_rotation_on_pressed" + android:gravity="center" /> + </item> + <item android:state_checked="true"> + <bitmap android:src="@drawable/ic_notify_rotation_on_normal" + android:gravity="center" /> + </item> + <item android:state_pressed="true"> + <bitmap android:src="@drawable/ic_notify_rotation_off_pressed" + android:gravity="center" /> + </item> + <item> + <bitmap android:src="@drawable/ic_notify_rotation_off_normal" + android:gravity="center" /> + </item> </selector> diff --git a/packages/SystemUI/res/drawable/status_bar_close.xml b/packages/SystemUI/res/drawable/status_bar_close.xml new file mode 100644 index 0000000..2efc3c3 --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_close.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/status_bar_close_on" /> + <item + android:drawable="@drawable/status_bar_close_off" /> +</selector> + diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index 8715a99..f69aac8 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -25,25 +25,24 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:background="@drawable/notification_tracking_bg" - android:paddingTop="@*android:dimen/status_bar_height" + android:background="@drawable/notification_panel_bg" + android:paddingTop="@dimen/notification_panel_padding_top" android:layout_marginLeft="@dimen/notification_panel_margin_left" > - <RelativeLayout + <LinearLayout android:layout_width="match_parent" - android:layout_height="52dp" - android:paddingTop="3dp" - android:paddingBottom="5dp" - android:paddingRight="3dp" + android:layout_height="wrap_content" + android:paddingTop="@dimen/notification_panel_header_padding_top" android:background="@drawable/notification_header_bg" + android:orientation="horizontal" + android:gravity="center_vertical" + android:baselineAligned="false" > <com.android.systemui.statusbar.policy.Clock android:id="@+id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_centerVertical="true" android:layout_marginLeft="8dp" android:singleLine="true" android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" @@ -52,64 +51,41 @@ <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:layout_marginRight="8dp" android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" /> - <!-- - <com.android.systemui.statusbar.phone.CarrierLabel - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:layout_marginTop="1dp" - android:layout_marginLeft="5dp" - android:layout_gravity="center_vertical" - android:paddingBottom="1dp" - android:paddingLeft="4dp" - android:textAppearance="?android:attr/textAppearanceLarge" - android:textColor="?android:attr/textColorSecondary" - /> - --> <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:layout_marginLeft="12dp" + android:layout_margin="8dp" 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:layout_width="48dp" + android:layout_height="48dp" + android:scaleType="center" android:src="@drawable/ic_notify_quicksettings" android:contentDescription="@string/accessibility_settings_button" /> + <Space + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_weight="1" + /> + <ImageView android:id="@+id/clear_all_button" - android:layout_width="32dp" - android:layout_height="32dp" - android:layout_marginLeft="8dp" - android:layout_centerVertical="true" - android:layout_alignParentRight="true" + android:layout_width="48dp" + android:layout_height="48dp" + android:scaleType="center" android:src="@drawable/ic_notify_clear" android:contentDescription="@string/accessibility_clear_all" /> - </RelativeLayout> - - <View - android:layout_width="match_parent" - android:layout_height="2dp" - android:layout_marginTop="52dp" - android:background="@drawable/status_bar_hr" - /> + </LinearLayout> <ScrollView android:id="@+id/scroll" @@ -117,8 +93,8 @@ android:layout_height="match_parent" android:fadingEdge="none" android:overScrollMode="ifContentScrolls" - android:layout_marginTop="54dp" - android:layout_marginBottom="34dp" + android:layout_marginTop="@dimen/notification_panel_header_height" + android:layout_marginBottom="@dimen/close_handle_underlap" > <com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@+id/latestItems" @@ -128,14 +104,6 @@ /> </ScrollView> - <ImageView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:src="@drawable/title_bar_shadow" - android:layout_marginTop="54dp" - android:scaleType="fitXY" - /> - <com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close" android:layout_width="match_parent" android:layout_height="@dimen/close_handle_height" @@ -144,10 +112,10 @@ > <ImageView android:layout_width="match_parent" - android:layout_height="34dp" + android:layout_height="@dimen/close_handle_height" android:layout_gravity="bottom" android:scaleType="fitXY" - android:src="@drawable/status_bar_close_on" + android:src="@drawable/status_bar_close" /> </com.android.systemui.statusbar.phone.CloseDragHandle> diff --git a/packages/SystemUI/res/layout/status_bar_tracking.xml b/packages/SystemUI/res/layout/status_bar_tracking.xml deleted file mode 100644 index c1b0066..0000000 --- a/packages/SystemUI/res/layout/status_bar_tracking.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2008 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. ---> - -<com.android.systemui.statusbar.phone.TrackingView - xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:visibility="gone" - android:focusable="true" - android:descendantFocusability="afterDescendants" - android:paddingBottom="0px" - android:paddingLeft="0px" - android:paddingRight="0px" - > - - <FrameLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:background="@drawable/notification_tracking_bg" - > - <com.android.systemui.statusbar.phone.CarrierLabel - android:textAppearance="@style/TextAppearance.StatusBar.Clock" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_gravity="bottom" - android:gravity="center" - android:paddingBottom="20dp" - /> - </FrameLayout> - - <com.android.systemui.statusbar.phone.CloseDragHandle android:id="@+id/close" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - > - <ImageView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="bottom" - android:scaleType="fitXY" - android:src="@drawable/status_bar_close_on" - /> - - </com.android.systemui.statusbar.phone.CloseDragHandle> - -</com.android.systemui.statusbar.phone.TrackingView> diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index 50a61b1..2ff62a5 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -16,8 +16,8 @@ */ --> <resources> - <!-- The width of the notification panel window --> - <dimen name="notification_panel_width">446dp</dimen> + <!-- The width of the notification panel window: 446 + 16 + 16 (padding in the bg drawable) --> + <dimen name="notification_panel_width">478dp</dimen> <!-- Layout parameters for the notification panel --> <dimen name="notification_panel_margin_bottom">192dp</dimen> @@ -36,4 +36,7 @@ <!-- Height of search panel including navigation bar height --> <dimen name="navbar_search_panel_height">300dip</dimen> + <!-- Extra space above the clock in the panel; on this device, zero --> + <dimen name="notification_panel_header_padding_top">0dp</dimen> + </resources> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 34714c4..ac2779f 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -25,7 +25,6 @@ <color name="status_bar_recents_app_label_color">#ffffffff</color> <drawable name="status_bar_notification_row_background_color">#ff090909</drawable> <drawable name="notification_header_bg">#FF000000</drawable> - <drawable name="notification_tracking_bg">#66000000</drawable> <color name="notification_list_shadow_top">#80000000</color> <drawable name="recents_callout_line">#99ffffff</drawable> <drawable name="notification_item_background_legacy_color">#ffaaaaaa</drawable> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 276d74b..b908188 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -125,7 +125,19 @@ <dimen name="navbar_search_panel_height">230dip</dimen> <!-- Height of the draggable handle at the bottom of the phone notification panel --> - <dimen name="close_handle_height">34dp</dimen> + <dimen name="close_handle_height">32dp</dimen> + + <!-- Amount of close_handle that will not overlap the notification list --> + <dimen name="close_handle_underlap">18dp</dimen> + + <!-- Height of the notification panel header bar --> + <dimen name="notification_panel_header_height">48dp</dimen> + + <!-- Height of the notification panel header bar --> + <dimen name="notification_panel_padding_top">@*android:dimen/status_bar_height</dimen> + + <!-- Extra space above the clock in the panel; half of (notification_panel_header_height - 32) --> + <dimen name="notification_panel_header_padding_top">0dp</dimen> <!-- Layout parameters for the notification panel --> <dimen name="notification_panel_margin_bottom">0dp</dimen> 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 1d281c5..f53a282 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -106,6 +106,7 @@ public class PhoneStatusBar extends BaseStatusBar { = "com.android.internal.policy.statusbar.START"; private static final boolean ENABLE_INTRUDERS = false; + private static final boolean DIM_BEHIND_EXPANDED_PANEL = false; static final int EXPANDED_LEAVE_ALONE = -10000; static final int EXPANDED_FULL_OPEN = -10001; @@ -1333,6 +1334,7 @@ public class PhoneStatusBar extends BaseStatusBar { mPile.setLayerType(View.LAYER_TYPE_NONE, null); mVelocityTracker.recycle(); mVelocityTracker = null; + mCloseView.setPressed(false); } void incrementAnim(long frameTimeNanos) { @@ -1371,6 +1373,8 @@ public class PhoneStatusBar extends BaseStatusBar { Slog.d(TAG, "panel: beginning to track the user's touch, y=" + y + " opening=" + opening); } + mCloseView.setPressed(true); + mTracking = true; mPile.setLayerType(View.LAYER_TYPE_HARDWARE, null); mVelocityTracker = VelocityTracker.obtain(); @@ -1497,8 +1501,8 @@ public class PhoneStatusBar extends BaseStatusBar { if (!mExpanded) { mViewDelta = statusBarSize - y; } else { -// mCloseView.getLocationOnScreen(mAbsPos)...? -// mViewDelta = mAbsPos[1] + mTrackingView.getHeight() - y; + mCloseView.getLocationOnScreen(mAbsPos); + mViewDelta = mAbsPos[1] + statusBarSize + getCloseViewHeight() - y; // XXX: not closeViewHeight, but paddingBottom from the 9patch } if ((!mExpanded && y < hitSize) || // @@ add taps outside the panel if it's not full-screen @@ -2011,7 +2015,7 @@ public class PhoneStatusBar extends BaseStatusBar { } mNotificationPanel.setLayoutParams(lp); - if (ActivityManager.isHighEndGfx(mDisplay)) { + if (DIM_BEHIND_EXPANDED_PANEL && ActivityManager.isHighEndGfx(mDisplay)) { // woo, special effects final int barh = getCloseViewHeight() + getStatusBarHeight(); final float frac = saturate((float)(panelh - barh) / (disph - barh)); |