[automerge] Fix bug where shade is infinitely squishy after wallpaper change 2p: cf293657bf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16827478

Change-Id: I47bb5858c1d71bfad9a6b0cbbd0a3917205986f1
This commit is contained in:
Lyn Han
2022-02-09 17:31:54 +00:00
committed by Presubmit Automerger Backend
2 changed files with 6 additions and 1 deletions

View File

@@ -279,11 +279,11 @@ public class NotificationStackScrollLayoutController {
@Override
public void onThemeChanged() {
updateShowEmptyShadeView();
mView.updateCornerRadius();
mView.updateBgColor();
mView.updateDecorViews();
mView.reinflateViews();
updateShowEmptyShadeView();
updateFooter();
}

View File

@@ -376,6 +376,11 @@ public class StackScrollAlgorithm {
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;
}