diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java index f506753379a4c..f899863dcc6b3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java @@ -299,6 +299,10 @@ public class ActivityLaunchAnimator { return top; } + public int getBottom() { + return bottom; + } + public int getWidth() { return right - left; } 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 d4d45ea52a853..1c0052e879fd8 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 @@ -2001,7 +2001,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView float interpolation = Interpolators.FAST_OUT_SLOW_IN.getInterpolation(params.getProgress()); int startClipTopAmount = params.getStartClipTopAmount(); if (mNotificationParent != null) { - top -= mNotificationParent.getTranslationY(); + float parentY = mNotificationParent.getTranslationY(); + top -= parentY; mNotificationParent.setTranslationZ(translationZ); int parentStartClipTopAmount = params.getParentStartClipTopAmount(); if (startClipTopAmount != 0) { @@ -2011,8 +2012,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mNotificationParent.setClipTopAmount(clipTopAmount); } mNotificationParent.setExtraWidthForClipping(extraWidthForClipping); - mNotificationParent.setMinimumHeightForClipping(params.getHeight() - + mNotificationParent.getActualHeight()); + float clipBottom = Math.max(params.getBottom(), + parentY + mNotificationParent.getActualHeight() + - mNotificationParent.getClipBottomAmount()); + float clipTop = Math.min(params.getTop(), parentY); + int minimumHeightForClipping = (int) (clipBottom - clipTop); + mNotificationParent.setMinimumHeightForClipping(minimumHeightForClipping); } else if (startClipTopAmount != 0) { int clipTopAmount = (int) MathUtils.lerp(startClipTopAmount, 0, interpolation); setClipTopAmount(clipTopAmount);