summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@google.com>2010-11-30 12:03:59 -0500
committerDaniel Sandler <dsandler@google.com>2010-11-30 15:32:55 -0500
commit373a9983742b3d2370c36183aca3cde4614e6185 (patch)
tree4582c14e6833fb227bb62b8d5941582b26eb0289 /packages
parentfefc0743f8b0e8a936f0d138de20eca025ffe8c7 (diff)
downloadframeworks_base-373a9983742b3d2370c36183aca3cde4614e6185.zip
frameworks_base-373a9983742b3d2370c36183aca3cde4614e6185.tar.gz
frameworks_base-373a9983742b3d2370c36183aca3cde4614e6185.tar.bz2
When updating notifications, always reuse the last row.
Ordinarily, changing the "when" slot when updating a Notification will move its expanded payload to the bottom of the notification panel's list. But if it's already at the bottom, this causes an unsightly out-then-in animation sequence. We now check for that exact situation. Bug: 3222274 Bug: 3162218 Change-Id: I8b643b3f8bce64e57a22bdbb06d92c196c2484c2
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index c55c87e..31311a4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -496,7 +496,7 @@ public class TabletStatusBar extends StatusBar {
final RemoteViews contentView = notification.notification.contentView;
- if (false) {
+ if (DEBUG) {
Slog.d(TAG, "old notification: when=" + oldNotification.notification.when
+ " ongoing=" + oldNotification.isOngoing()
+ " expanded=" + oldEntry.expanded
@@ -508,7 +508,7 @@ public class TabletStatusBar extends StatusBar {
// Can we just reapply the RemoteViews in place? If when didn't change, the order
// didn't change.
- if (notification.notification.when == oldNotification.notification.when
+ boolean orderUnchanged = (notification.notification.when == oldNotification.notification.when
&& notification.isOngoing() == oldNotification.isOngoing()
&& oldEntry.expanded != null
&& contentView != null
@@ -516,7 +516,10 @@ public class TabletStatusBar extends StatusBar {
&& contentView.getPackage() != null
&& oldContentView.getPackage() != null
&& oldContentView.getPackage().equals(contentView.getPackage())
- && oldContentView.getLayoutId() == contentView.getLayoutId()) {
+ && oldContentView.getLayoutId() == contentView.getLayoutId());
+ ViewGroup rowParent = (ViewGroup) oldEntry.row.getParent();
+ boolean isLastAnyway = rowParent.indexOfChild(oldEntry.row) == rowParent.getChildCount() - 1;
+ if (orderUnchanged || isLastAnyway) {
if (DEBUG) Slog.d(TAG, "reusing notification for key: " + key);
oldEntry.notification = notification;
try {