diff options
26 files changed, 91 insertions, 17 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index f962259..edeeee2 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -796,6 +796,12 @@ public class Notification implements Parcelable if (this.icon != 0) { contentView.setImageViewResource(R.id.icon, this.icon); } + if (priority < PRIORITY_LOW) { + contentView.setInt(R.id.icon, + "setBackgroundResource", R.drawable.notification_template_icon_low_bg); + contentView.setInt(R.id.status_bar_latest_event_content, + "setBackgroundResource", R.drawable.notification_bg_low); + } if (contentTitle != null) { contentView.setTextViewText(R.id.title, contentTitle); } @@ -1364,6 +1370,12 @@ public class Notification implements Parcelable contentView.setImageViewBitmap(R.id.icon, mLargeIcon); smallIconImageViewId = R.id.right_icon; } + if (mPriority < PRIORITY_LOW) { + contentView.setInt(R.id.icon, + "setBackgroundResource", R.drawable.notification_template_icon_low_bg); + contentView.setInt(R.id.status_bar_latest_event_content, + "setBackgroundResource", R.drawable.notification_bg_low); + } if (mSmallIcon != 0) { contentView.setImageViewResource(smallIconImageViewId, mSmallIcon); contentView.setViewVisibility(smallIconImageViewId, View.VISIBLE); diff --git a/core/res/res/drawable-hdpi/notification_bg_low_normal.9.png b/core/res/res/drawable-hdpi/notification_bg_low_normal.9.png Binary files differnew file mode 100644 index 0000000..af91f5e --- /dev/null +++ b/core/res/res/drawable-hdpi/notification_bg_low_normal.9.png diff --git a/core/res/res/drawable-hdpi/notification_bg_low_pressed.9.png b/core/res/res/drawable-hdpi/notification_bg_low_pressed.9.png Binary files differnew file mode 100644 index 0000000..1602ab8 --- /dev/null +++ b/core/res/res/drawable-hdpi/notification_bg_low_pressed.9.png diff --git a/core/res/res/drawable-hdpi/notification_bg_normal.9.png b/core/res/res/drawable-hdpi/notification_bg_normal.9.png Binary files differnew file mode 100644 index 0000000..6ebed8b --- /dev/null +++ b/core/res/res/drawable-hdpi/notification_bg_normal.9.png diff --git a/core/res/res/drawable-hdpi/notification_bg_normal_pressed.9.png b/core/res/res/drawable-hdpi/notification_bg_normal_pressed.9.png Binary files differnew file mode 100644 index 0000000..6193822 --- /dev/null +++ b/core/res/res/drawable-hdpi/notification_bg_normal_pressed.9.png diff --git a/core/res/res/drawable-mdpi/notification_bg_low_normal.9.png b/core/res/res/drawable-mdpi/notification_bg_low_normal.9.png Binary files differnew file mode 100644 index 0000000..62de9d7 --- /dev/null +++ b/core/res/res/drawable-mdpi/notification_bg_low_normal.9.png diff --git a/core/res/res/drawable-mdpi/notification_bg_low_pressed.9.png b/core/res/res/drawable-mdpi/notification_bg_low_pressed.9.png Binary files differnew file mode 100644 index 0000000..eaabd93 --- /dev/null +++ b/core/res/res/drawable-mdpi/notification_bg_low_pressed.9.png diff --git a/core/res/res/drawable-mdpi/notification_bg_normal.9.png b/core/res/res/drawable-mdpi/notification_bg_normal.9.png Binary files differnew file mode 100644 index 0000000..aa239b3 --- /dev/null +++ b/core/res/res/drawable-mdpi/notification_bg_normal.9.png diff --git a/core/res/res/drawable-mdpi/notification_bg_normal_pressed.9.png b/core/res/res/drawable-mdpi/notification_bg_normal_pressed.9.png Binary files differnew file mode 100644 index 0000000..62d8622 --- /dev/null +++ b/core/res/res/drawable-mdpi/notification_bg_normal_pressed.9.png diff --git a/core/res/res/drawable-xhdpi/notification_bg_low_normal.9.png b/core/res/res/drawable-xhdpi/notification_bg_low_normal.9.png Binary files differnew file mode 100644 index 0000000..8c884de --- /dev/null +++ b/core/res/res/drawable-xhdpi/notification_bg_low_normal.9.png diff --git a/core/res/res/drawable-xhdpi/notification_bg_low_pressed.9.png b/core/res/res/drawable-xhdpi/notification_bg_low_pressed.9.png Binary files differnew file mode 100644 index 0000000..32e00be --- /dev/null +++ b/core/res/res/drawable-xhdpi/notification_bg_low_pressed.9.png diff --git a/core/res/res/drawable-xhdpi/notification_bg_normal.9.png b/core/res/res/drawable-xhdpi/notification_bg_normal.9.png Binary files differnew file mode 100644 index 0000000..bdf477b --- /dev/null +++ b/core/res/res/drawable-xhdpi/notification_bg_normal.9.png diff --git a/core/res/res/drawable-xhdpi/notification_bg_normal_pressed.9.png b/core/res/res/drawable-xhdpi/notification_bg_normal_pressed.9.png Binary files differnew file mode 100644 index 0000000..5c4da74 --- /dev/null +++ b/core/res/res/drawable-xhdpi/notification_bg_normal_pressed.9.png diff --git a/core/res/res/drawable/notification_bg.xml b/core/res/res/drawable/notification_bg.xml index 1bb2172..362a524 100644 --- a/core/res/res/drawable/notification_bg.xml +++ b/core/res/res/drawable/notification_bg.xml @@ -17,6 +17,6 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_mediumAnimTime"> - <item android:state_pressed="true" android:drawable="@drawable/notification_item_background_color_pressed" /> - <item android:state_pressed="false" android:drawable="@drawable/notification_item_background_color" /> + <item android:state_pressed="true" android:drawable="@drawable/notification_bg_normal_pressed" /> + <item android:state_pressed="false" android:drawable="@drawable/notification_bg_normal" /> </selector> diff --git a/core/res/res/drawable/notification_bg_low.xml b/core/res/res/drawable/notification_bg_low.xml new file mode 100644 index 0000000..466a885 --- /dev/null +++ b/core/res/res/drawable/notification_bg_low.xml @@ -0,0 +1,22 @@ +<?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" + android:exitFadeDuration="@android:integer/config_mediumAnimTime"> + + <item android:state_pressed="true" android:drawable="@drawable/notification_bg_low_pressed" /> + <item android:state_pressed="false" android:drawable="@drawable/notification_bg_low_normal" /> +</selector> diff --git a/core/res/res/layout/notification_action.xml b/core/res/res/layout/notification_action.xml index 785da7c..36982ca 100644 --- a/core/res/res/layout/notification_action.xml +++ b/core/res/res/layout/notification_action.xml @@ -17,7 +17,10 @@ <Button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/action0" android:layout_width="match_parent" - android:layout_height="wrap_content" - style="@android:style/Widget.Holo.Button.Small" + android:layout_height="48dp" android:gravity="left|center_vertical" - />
\ No newline at end of file + android:drawablePadding="8dp" + android:paddingLeft="8dp" + android:textColor="#ccc" + android:textSize="14dp" + /> diff --git a/core/res/res/layout/notification_action_tombstone.xml b/core/res/res/layout/notification_action_tombstone.xml new file mode 100644 index 0000000..e61e15f --- /dev/null +++ b/core/res/res/layout/notification_action_tombstone.xml @@ -0,0 +1,26 @@ +<?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. +--> + +<Button xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/action0" + android:layout_width="match_parent" + android:layout_height="48dp" + android:gravity="left|center_vertical" + android:drawablePadding="8dp" + android:paddingLeft="8dp" + android:textColor="#666" + android:textSize="14dp" + /> diff --git a/core/res/res/layout/notification_template_base.xml b/core/res/res/layout/notification_template_base.xml index 63d20e4..3692a4d 100644 --- a/core/res/res/layout/notification_template_base.xml +++ b/core/res/res/layout/notification_template_base.xml @@ -26,7 +26,7 @@ <ImageView android:id="@+id/icon" android:layout_width="@dimen/notification_large_icon_width" android:layout_height="@dimen/notification_large_icon_height" - android:background="@android:drawable/notify_panel_notification_icon_bg_tile" + android:background="@android:drawable/notification_template_icon_bg" android:scaleType="center" /> <LinearLayout diff --git a/core/res/res/layout/notification_template_big_base.xml b/core/res/res/layout/notification_template_big_base.xml index f8b24e2..378161c 100644 --- a/core/res/res/layout/notification_template_big_base.xml +++ b/core/res/res/layout/notification_template_big_base.xml @@ -26,7 +26,7 @@ <ImageView android:id="@+id/icon" android:layout_width="@dimen/notification_large_icon_width" android:layout_height="@dimen/notification_large_icon_height" - android:background="@android:drawable/notify_panel_notification_icon_bg_tile" + android:background="@android:drawable/notification_template_icon_bg" android:scaleType="center" /> <LinearLayout diff --git a/core/res/res/layout/notification_template_big_text.xml b/core/res/res/layout/notification_template_big_text.xml index a225ab1..d0549cf 100644 --- a/core/res/res/layout/notification_template_big_text.xml +++ b/core/res/res/layout/notification_template_big_text.xml @@ -25,7 +25,7 @@ <ImageView android:id="@+id/icon" android:layout_width="@dimen/notification_large_icon_width" android:layout_height="@dimen/notification_large_icon_height" - android:background="@android:drawable/notify_panel_notification_icon_bg_tile" + android:background="@android:drawable/notification_template_icon_bg" android:scaleType="center" /> <LinearLayout diff --git a/core/res/res/layout/notification_template_inbox.xml b/core/res/res/layout/notification_template_inbox.xml index 05a3d62..7b63ac5 100644 --- a/core/res/res/layout/notification_template_inbox.xml +++ b/core/res/res/layout/notification_template_inbox.xml @@ -15,14 +15,18 @@ --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:internal="http://schemas.android.com/apk/prv/res/android" android:id="@+id/status_bar_latest_event_content" + android:background="@android:drawable/notification_bg" android:layout_width="match_parent" android:layout_height="wrap_content" + internal:layout_minHeight="65dp" + internal:layout_maxHeight="unbounded" > <ImageView android:id="@+id/icon" android:layout_width="@dimen/notification_large_icon_width" android:layout_height="@dimen/notification_large_icon_height" - android:background="@android:drawable/notify_panel_notification_icon_bg_tile" + android:background="@android:drawable/notification_template_icon_bg" android:scaleType="center" /> <LinearLayout diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml index e23e3c6..41f902f 100644 --- a/core/res/res/values/colors.xml +++ b/core/res/res/values/colors.xml @@ -181,5 +181,8 @@ <!-- A really bright Holo shade of blue --> <color name="holo_blue_bright">#ff00ddff</color> + <drawable name="notification_template_icon_bg">#3333B5E5</drawable> + <drawable name="notification_template_icon_low_bg">#0cffffff</drawable> + </resources> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index d3f27e1..d899a1a 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -208,6 +208,7 @@ <java-symbol type="id" name="inbox_text2" /> <java-symbol type="id" name="inbox_text3" /> <java-symbol type="id" name="inbox_text4" /> + <java-symbol type="id" name="status_bar_latest_event_content" /> <java-symbol type="attr" name="actionModeShareDrawable" /> <java-symbol type="attr" name="alertDialogCenterButtons" /> @@ -1004,6 +1005,9 @@ <java-symbol type="drawable" name="ic_lockscreen_unlock" /> <java-symbol type="drawable" name="ic_lockscreen_search" /> <java-symbol type="drawable" name="notification_bg" /> + <java-symbol type="drawable" name="notification_bg_low" /> + <java-symbol type="drawable" name="notification_template_icon_bg" /> + <java-symbol type="drawable" name="notification_template_icon_low_bg" /> <java-symbol type="layout" name="action_bar_home" /> <java-symbol type="layout" name="action_bar_title_item" /> @@ -1091,6 +1095,7 @@ <java-symbol type="layout" name="zoom_controls" /> <java-symbol type="layout" name="zoom_magnify" /> <java-symbol type="layout" name="notification_action" /> + <java-symbol type="layout" name="notification_action_tombstone" /> <java-symbol type="layout" name="notification_intruder_content" /> <java-symbol type="layout" name="notification_template_base" /> <java-symbol type="layout" name="notification_template_big_base" /> diff --git a/packages/SystemUI/res/layout/status_bar_notification_row.xml b/packages/SystemUI/res/layout/status_bar_notification_row.xml index e69cd8a..7491939 100644 --- a/packages/SystemUI/res/layout/status_bar_notification_row.xml +++ b/packages/SystemUI/res/layout/status_bar_notification_row.xml @@ -1,7 +1,6 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@*android:drawable/notification_bg" > <View @@ -34,7 +33,6 @@ > <com.android.internal.widget.SizeAdaptiveLayout android:id="@+id/adaptive" - android:background="@*android:drawable/notification_bg" android:layout_width="match_parent" android:layout_height="wrap_content" /> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index b908188..2ff0e00 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -49,14 +49,14 @@ reducing false presses on navbar buttons; approx 2mm --> <dimen name="navigation_bar_deadzone_size">12dp</dimen> - <!-- thickness (height) of each notification row, including any separators or padding --> - <dimen name="notification_height">68dp</dimen> + <!-- thickness (height) of each 1U notification row plus glow, padding, etc --> + <dimen name="notification_height">72dp</dimen> <!-- Height of notification icons in the status bar --> <dimen name="status_bar_icon_size">@*android:dimen/status_bar_icon_size</dimen> - <!-- Height of a small notification in the status bar --> - <dimen name="notification_min_height">@android:dimen/notification_large_icon_height</dimen> + <!-- Height of a small notification in the status bar plus glow, padding, etc --> + <dimen name="notification_min_height">72dp</dimen> <!-- Height of a small notification in the status bar --> <!-- TODO: change this back to 256dp once we deal with actions. --> @@ -71,8 +71,8 @@ <!-- gap on either side of status bar notification icons --> <dimen name="status_bar_icon_padding">0dp</dimen> - <!-- thickness (height) of dividers between each notification row --> - <dimen name="notification_divider_height">2dp</dimen> + <!-- half the distance between notifications in the panel --> + <dimen name="notification_divider_height">4dp</dimen> <!-- Notification drawer tuning parameters (phone UI) --> <!-- Initial velocity of the shade when expanding on its own --> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index f0db2bc..37fb53d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import android.app.ActivityManagerNative; import android.app.KeyguardManager; +import android.app.Notification; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; |
