summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-11-30 00:05:39 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-11-30 00:05:39 +0000
commit3e6fb4c8dc4a0be9eed5dd2a4977a8da9aa5a57c (patch)
treea4edeb5ab75695b8c3425739d58554819ec5482b
parente59ac13c375ce1c04d05429826a3d993fea4d9a2 (diff)
parent6487ebffd574a188336c0e710fe97c61b2df21d2 (diff)
Merge "Fixed the inline launch animation for notification groups"
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java10
3 files changed, 18 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
index 7970f166d8a6..1616b6dc53de 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
@@ -176,9 +176,12 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
}
// Check if the notification is displaying the menu, if so slide notification back
- if (row.getProvider() != null && row.getProvider().isMenuVisible()) {
+ if (isMenuVisible(row)) {
row.animateTranslateNotification(0);
return;
+ } else if (row.isChildInGroup() && isMenuVisible(row.getNotificationParent())) {
+ row.getNotificationParent().animateTranslateNotification(0);
+ return;
}
// Mark notification for one frame.
@@ -193,6 +196,10 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
mCallback.onNotificationClicked(sbn, row);
}
+ private boolean isMenuVisible(ExpandableNotificationRow row) {
+ return row.getProvider() != null && row.getProvider().isMenuVisible();
+ }
+
public void register(ExpandableNotificationRow row, StatusBarNotification sbn) {
Notification notification = sbn.getNotification();
if (notification.contentIntent != null || notification.fullScreenIntent != null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
index 0cd431f9d25b..d4d45ea52a85 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
@@ -2067,6 +2067,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
private void setChildIsExpanding(boolean isExpanding) {
mChildIsExpanding = isExpanding;
+ updateClipping();
+ invalidate();
}
@Override
@@ -2968,7 +2970,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
return true;
}
} else if (child == mChildrenContainer) {
- if (!mChildIsExpanding && (isClippingNeeded() || !hasNoRounding())) {
+ if (isClippingNeeded() || !hasNoRounding()) {
return true;
}
} else if (child instanceof NotificationGuts) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java
index a7aed5fce2e1..0efb1308e83e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableOutlineView.java
@@ -115,12 +115,14 @@ public abstract class ExpandableOutlineView extends ExpandableView {
if (!mCustomOutline) {
int translation = mShouldTranslateContents && !ignoreTranslation
? (int) getTranslation() : 0;
- left = Math.max(translation, 0);
+ int halfExtraWidth = (int) (mExtraWidthForClipping / 2.0f);
+ left = Math.max(translation, 0) - halfExtraWidth;
top = mClipTopAmount + mBackgroundTop;
- right = getWidth() + Math.min(translation, 0);
+ right = getWidth() + halfExtraWidth + Math.min(translation, 0);
// If the top is rounded we want the bottom to be at most at the top roundness, in order
// to avoid the shadow changing when scrolling up.
- bottom = Math.max(getActualHeight() - mClipBottomAmount, (int) (top + topRoundness));
+ bottom = Math.max(mMinimumHeightForClipping,
+ Math.max(getActualHeight() - mClipBottomAmount, (int) (top + topRoundness)));
} else {
left = mOutlineRect.left;
top = mOutlineRect.top;
@@ -219,10 +221,12 @@ public abstract class ExpandableOutlineView extends ExpandableView {
public void setExtraWidthForClipping(float extraWidthForClipping) {
mExtraWidthForClipping = extraWidthForClipping;
+ invalidate();
}
public void setMinimumHeightForClipping(int minimumHeightForClipping) {
mMinimumHeightForClipping = minimumHeightForClipping;
+ invalidate();
}
@Override