commit | 8184414d59abc2db41660a156811222a1b5746fb | [log] [tgz] |
---|---|---|
author | Lyn Han <lynhan@google.com> | Wed Feb 09 17:30:51 2022 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Wed Feb 09 17:30:51 2022 +0000 |
tree | 76d6a49be166a462d32bbe835e2002b0378ec050 | |
parent | 63451ce1ca35b8516700cd0c12c069f772ca99f6 [diff] | |
parent | d2adae5b5d8a1b6a77386cc7eaf98dafe4b43ce4 [diff] |
Merge "Fix bug where shade is infinitely squishy after wallpaper change"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index e1116f8..d1c63e3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
@@ -290,11 +290,11 @@ @Override public void onThemeChanged() { - updateShowEmptyShadeView(); mView.updateCornerRadius(); mView.updateBgColor(); mView.updateDecorViews(); mView.reinflateViews(); + updateShowEmptyShadeView(); updateFooter(); }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index e24cd3e..3a3f581 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
@@ -376,6 +376,11 @@ final float stackHeight = ambientState.getStackHeight() - shelfHeight - scrimPadding; final float stackEndHeight = ambientState.getStackEndHeight() - shelfHeight - scrimPadding; + if (stackEndHeight == 0f) { + // This should not happen, since even when the shade is empty we show EmptyShadeView + // but check just in case, so we don't return infinity or NaN. + return 0f; + } return stackHeight / stackEndHeight; }