summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2014-02-27 17:43:26 -0500
committerChris Wren <cwren@android.com>2014-02-28 11:20:11 -0500
commit8fd39ec46b056c88f0d08758d04badab29a8786a (patch)
tree007432bf701446c6165998446b9fb4fc1abee611 /packages/SystemUI/src
parent22ae46efddd9ea708c977a33e22279531e26a39c (diff)
downloadframeworks_base-8fd39ec46b056c88f0d08758d04badab29a8786a.zip
frameworks_base-8fd39ec46b056c88f0d08758d04badab29a8786a.tar.gz
frameworks_base-8fd39ec46b056c88f0d08758d04badab29a8786a.tar.bz2
create a synthetic 2U heads up notification
combine the 1U with the action buttons to make a mid-sized notification bounded to 128dp by the system ui used for the heads up Bug: 13208692 Change-Id: I382bb0bd1ce73f35295f05ca2606195986cff1d3
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 74e9704..0c50cda 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -685,6 +685,13 @@ public abstract class BaseStatusBar extends SystemUI implements
StatusBarNotification sbn = entry.notification;
RemoteViews contentView = sbn.getNotification().contentView;
RemoteViews bigContentView = sbn.getNotification().bigContentView;
+
+ if (isHeadsUp) {
+ maxHeight =
+ mContext.getResources().getDimensionPixelSize(R.dimen.notification_mid_height);
+ bigContentView = sbn.getNotification().headsUpContentView;
+ }
+
if (contentView == null) {
return false;
}
@@ -1040,6 +1047,8 @@ public abstract class BaseStatusBar extends SystemUI implements
final RemoteViews contentView = notification.getNotification().contentView;
final RemoteViews oldBigContentView = oldNotification.getNotification().bigContentView;
final RemoteViews bigContentView = notification.getNotification().bigContentView;
+ final RemoteViews oldHeadsUpContentView = oldNotification.getNotification().headsUpContentView;
+ final RemoteViews headsUpContentView = notification.getNotification().headsUpContentView;
final Notification oldPublicNotification = oldNotification.getNotification().publicVersion;
final RemoteViews oldPublicContentView = oldPublicNotification != null
? oldPublicNotification.contentView : null;
@@ -1079,6 +1088,13 @@ public abstract class BaseStatusBar extends SystemUI implements
&& oldBigContentView.getPackage() != null
&& oldBigContentView.getPackage().equals(bigContentView.getPackage())
&& oldBigContentView.getLayoutId() == bigContentView.getLayoutId());
+ boolean headsUpContentsUnchanged =
+ (oldHeadsUpContentView == null && headsUpContentView == null)
+ || ((oldHeadsUpContentView != null && headsUpContentView != null)
+ && headsUpContentView.getPackage() != null
+ && oldHeadsUpContentView.getPackage() != null
+ && oldHeadsUpContentView.getPackage().equals(headsUpContentView.getPackage())
+ && oldHeadsUpContentView.getLayoutId() == headsUpContentView.getLayoutId());
boolean publicUnchanged =
(oldPublicContentView == null && publicContentView == null)
|| ((oldPublicContentView != null && publicContentView != null)
@@ -1097,7 +1113,7 @@ public abstract class BaseStatusBar extends SystemUI implements
&& !TextUtils.equals(notification.getNotification().tickerText,
oldEntry.notification.getNotification().tickerText);
boolean isTopAnyway = isTopNotification(rowParent, oldEntry);
- if (contentsUnchanged && bigContentsUnchanged && publicUnchanged
+ if (contentsUnchanged && bigContentsUnchanged && headsUpContentsUnchanged && publicUnchanged
&& (orderUnchanged || isTopAnyway)) {
if (DEBUG) Log.d(TAG, "reusing notification for key: " + key);
oldEntry.notification = notification;
@@ -1181,7 +1197,9 @@ public abstract class BaseStatusBar extends SystemUI implements
private void updateNotificationViews(NotificationData.Entry entry,
StatusBarNotification notification, boolean isHeadsUp) {
final RemoteViews contentView = notification.getNotification().contentView;
- final RemoteViews bigContentView = notification.getNotification().bigContentView;
+ final RemoteViews bigContentView = isHeadsUp
+ ? notification.getNotification().headsUpContentView
+ : notification.getNotification().bigContentView;
final Notification publicVersion = notification.getNotification().publicVersion;
final RemoteViews publicContentView = publicVersion != null ? publicVersion.contentView
: null;