From 8c61850c78175c1af4511543bc6a8b2b94775853 Mon Sep 17 00:00:00 2001 From: Jordan Demeulenaere Date: Tue, 2 Mar 2021 14:25:49 +0100 Subject: [PATCH] Fix notifications z-height when they don't have shadows. This CL improves the animation triggered when we launch an app after tapping a notification. See b/181654098 for after/before videos. Bug: 181654098 Test: Manual Change-Id: I6af80597c7e4588c2197371d6cdf18f44635cb5e --- .../statusbar/notification/row/ExpandableNotificationRow.java | 3 +-- .../systemui/statusbar/notification/stack/AmbientState.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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 1251b58171da0..52063285ac010 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 @@ -2052,8 +2052,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mNotificationLaunchHeight, zProgress); setTranslationZ(translationZ); - float extraWidthForClipping = params.getWidth() - getWidth() - + MathUtils.lerp(0, mOutlineRadius * 2, params.getProgress()); + float extraWidthForClipping = params.getWidth() - getWidth(); setExtraWidthForClipping(extraWidthForClipping); int top = params.getTop(); float interpolation = Interpolators.FAST_OUT_SLOW_IN.getInterpolation(params.getProgress()); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java index 756fe6c5ba24d..8446b4e6a3f0e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java @@ -133,7 +133,7 @@ public class AmbientState { */ public static int getNotificationLaunchHeight(Context context) { int zDistance = getZDistanceBetweenElements(context); - return getBaseHeight(zDistance) * 2; + return NOTIFICATIONS_HAVE_SHADOWS ? 2 * getBaseHeight(zDistance) : 4 * zDistance; } /**