From ebce0115e239919680fc5574ae4ca79e617fcce8 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Thu, 16 Jun 2011 16:44:51 -0400 Subject: ICS updates to notification layouts. Of note: 1. There is no "X" (veto) button anymore. (Well, there is, but it's offscreen so it should still be available to assistive devices.) Users can use "Clear all" or the new swipe-to-veto gesture to clear notifications. 2. As a consequence of #1, your layout goes all the way to the right edge of the notifications panel again. Enjoy the extra space! 3. The numeric bubble in the notification icon is now capped at "999+" like it is in the expanded notification view. (Note that this involves a couple of new public framework resources: one to indicate the number beyond which the substitution string will be used, and one specifying a localizable substitution string.) Bug: 4651514 Bug: 4686329 Bug: 4501990 Change-Id: I0e6bdb6aec4fe5bfc927eb1aba955d444a9414ec --- api/current.txt | 2 + core/java/android/app/Notification.java | 10 +-- .../res/layout/status_bar_latest_event_content.xml | 39 ++-------- .../status_bar_latest_event_content_large_icon.xml | 83 +++++++++++++--------- core/res/res/values-sw600dp/styles.xml | 21 ------ core/res/res/values/config.xml | 6 ++ core/res/res/values/public.xml | 3 + core/res/res/values/strings.xml | 10 +-- core/res/res/values/styles.xml | 10 +-- .../layout-sw600dp/status_bar_notification_row.xml | 45 ------------ .../res/layout/status_bar_notification_row.xml | 3 +- .../systemui/statusbar/StatusBarIconView.java | 15 +++- .../statusbar/policy/NotificationRowLayout.java | 44 +++++++++--- 13 files changed, 131 insertions(+), 160 deletions(-) delete mode 100644 packages/SystemUI/res/layout-sw600dp/status_bar_notification_row.xml diff --git a/api/current.txt b/api/current.txt index 12d9cc2..5d12635 100644 --- a/api/current.txt +++ b/api/current.txt @@ -1374,6 +1374,7 @@ package android { field public static final int config_longAnimTime = 17694722; // 0x10e0002 field public static final int config_mediumAnimTime = 17694721; // 0x10e0001 field public static final int config_shortAnimTime = 17694720; // 0x10e0000 + field public static final int status_bar_notification_info_maxnum = 17694723; // 0x10e0003 } public static final class R.interpolator { @@ -1460,6 +1461,7 @@ package android { field public static final int search_go = 17039372; // 0x104000c field public static final int selectAll = 17039373; // 0x104000d field public static final int selectTextMode = 17039382; // 0x1040016 + field public static final int status_bar_notification_info_overflow = 17039383; // 0x1040017 field public static final int unknownName = 17039374; // 0x104000e field public static final int untitled = 17039375; // 0x104000f field public static final int yes = 17039379; // 0x1040013 diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index c9351af..170d2b5 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -929,15 +929,15 @@ public class Notification implements Parcelable if (mContentInfo != null) { contentView.setTextViewText(R.id.info, mContentInfo); } else if (mNumber > 0) { - if (mNumber > 999) { - contentView.setTextViewText(R.id.info, "999+"); + final int tooBig = mContext.getResources().getInteger( + R.integer.status_bar_notification_info_maxnum); + if (mNumber > tooBig) { + contentView.setTextViewText(R.id.info, mContext.getResources().getString( + R.string.status_bar_notification_info_overflow)); } else { NumberFormat f = NumberFormat.getIntegerInstance(); contentView.setTextViewText(R.id.info, f.format(mNumber)); } - contentView.setFloat(R.id.info, "setTextSize", - mContext.getResources().getDimensionPixelSize( - R.dimen.status_bar_content_number_size)); } else { contentView.setViewVisibility(R.id.info, View.GONE); } diff --git a/core/res/res/layout/status_bar_latest_event_content.xml b/core/res/res/layout/status_bar_latest_event_content.xml index 676c38b..0dc6741 100644 --- a/core/res/res/layout/status_bar_latest_event_content.xml +++ b/core/res/res/layout/status_bar_latest_event_content.xml @@ -1,4 +1,5 @@ @@ -8,41 +9,9 @@ android:background="@drawable/notify_panel_notification_icon_bg" android:scaleType="center" /> - - - - - - diff --git a/core/res/res/layout/status_bar_latest_event_content_large_icon.xml b/core/res/res/layout/status_bar_latest_event_content_large_icon.xml index ebdaaa3..d937392 100644 --- a/core/res/res/layout/status_bar_latest_event_content_large_icon.xml +++ b/core/res/res/layout/status_bar_latest_event_content_large_icon.xml @@ -1,50 +1,65 @@ + + - + + - - - diff --git a/core/res/res/values-sw600dp/styles.xml b/core/res/res/values-sw600dp/styles.xml index 7515c98..645db13 100644 --- a/core/res/res/values-sw600dp/styles.xml +++ b/core/res/res/values-sw600dp/styles.xml @@ -15,27 +15,6 @@ --> - - - - - - - - - -