diff options
author | Christoph Studer <chstuder@google.com> | 2014-07-29 22:57:21 +0200 |
---|---|---|
committer | Christoph Studer <chstuder@google.com> | 2014-07-30 11:40:24 +0000 |
commit | 22f2ee567dd1b1a42432251229bcb2f05c1c4700 (patch) | |
tree | ac508f8094d596379b7e350539a31655db86be97 /packages | |
parent | 6c9eee87476411faebcfa68c82abaae86344ef91 (diff) | |
download | frameworks_base-22f2ee567dd1b1a42432251229bcb2f05c1c4700.zip frameworks_base-22f2ee567dd1b1a42432251229bcb2f05c1c4700.tar.gz frameworks_base-22f2ee567dd1b1a42432251229bcb2f05c1c4700.tar.bz2 |
SysUI: Reset background treatment when re-using Entries
Bug: 16220667
Change-Id: I8fd2770fa5ea554728eb8cd70ce4a6171e28ece5
Diffstat (limited to 'packages')
4 files changed, 32 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java index 944a407..4d7698a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java @@ -660,6 +660,12 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView mOnActivatedListener = onActivatedListener; } + public void reset() { + setTintColor(0); + setShowingLegacyBackground(false); + setBelowSpeedBump(false); + } + public interface OnActivatedListener { void onActivated(ActivatableNotificationView view); void onActivationReset(ActivatableNotificationView view); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 48fc4ec..dff3f55 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1025,7 +1025,7 @@ public abstract class BaseStatusBar extends SystemUI implements hasUserChangedExpansion = row.hasUserChangedExpansion(); userExpanded = row.isUserExpanded(); userLocked = row.isUserLocked(); - row.reset(); + entry.reset(); if (hasUserChangedExpansion) { row.setUserExpanded(userExpanded); } @@ -1369,10 +1369,6 @@ public abstract class BaseStatusBar extends SystemUI implements updateNotifications(); } - private void addNotificationViews(StatusBarNotification notification, RankingMap ranking) { - addNotificationViews(createNotificationViews(notification), ranking); - } - /** * @return The number of notifications we show on Keyguard. */ @@ -1615,6 +1611,13 @@ public abstract class BaseStatusBar extends SystemUI implements } else { if (DEBUG) Log.d(TAG, "rebuilding update in place for key: " + key); oldEntry.notification = notification; + final StatusBarIcon ic = new StatusBarIcon(notification.getPackageName(), + notification.getUser(), + notification.getNotification().icon, + notification.getNotification().iconLevel, + notification.getNotification().number, + notification.getNotification().tickerText); + oldEntry.icon.set(ic); inflateViews(oldEntry, mStackScroller, wasHeadsUp); updateNotifications(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java index 3410834..e042a53 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java @@ -62,7 +62,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { /** * Resets this view so it can be re-used for an updated notification. */ + @Override public void reset() { + super.reset(); mRowMinHeight = 0; mRowMaxHeight = 0; mExpandable = false; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java index ed3ebf5..a1ab7ec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java @@ -72,6 +72,22 @@ public class NotificationData { public boolean hasInterrupted() { return interruption; } + + /** + * Resets the notification entry to be re-used. + */ + public void reset() { + // NOTE: Icon needs to be preserved for now. + // We should fix this at some point. + expanded = null; + expandedPublic = null; + expandedBig = null; + autoRedacted = false; + legacy = false; + if (row != null) { + row.reset(); + } + } } private final ArrayList<Entry> mEntries = new ArrayList<Entry>(); |