Merge "Use correct stack height when bypass enabled." into sc-dev am: 44cd9995db

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

Change-Id: Ief9db8b88ee36471affe960f247635f05c7768bb
This commit is contained in:
Jeff DeCew
2021-07-27 14:52:47 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 22 deletions

View File

@@ -154,15 +154,6 @@ public class AmbientState {
return mStackHeight; return mStackHeight;
} }
/**
* @return Height of notifications panel, with the animation from pulseHeight accounted for.
*/
// TODO(b/192348384): move this logic to getStackHeight, and remove this and getInnerHeight
public float getPulseStackHeight() {
float pulseHeight = Math.min(mPulseHeight, mStackHeight);
return MathUtils.lerp(mStackHeight, pulseHeight, mDozeAmount);
}
/** Tracks the state from AlertingNotificationManager#hasNotifications() */ /** Tracks the state from AlertingNotificationManager#hasNotifications() */
private boolean mHasAlertEntries; private boolean mHasAlertEntries;

View File

@@ -447,19 +447,16 @@ public class StackScrollAlgorithm {
// to shelf start, thereby hiding all notifications (except the first one, which // to shelf start, thereby hiding all notifications (except the first one, which
// we later unhide in updatePulsingState) // we later unhide in updatePulsingState)
// TODO(b/192348384): merge InnerHeight with StackHeight // TODO(b/192348384): merge InnerHeight with StackHeight
final int stackBottom; // Note: Bypass pulse looks different, but when it is not expanding, we need
if (ambientState.isBypassEnabled()) { // to use the innerHeight which doesn't update continuously, otherwise we show
// We want to use the stackHeight when pulse expanding, since the animation // more notifications than we should during this special transitional states.
// isn't currently optimized if the pulseHeight is continuously changing boolean bypassPulseNotExpanding = ambientState.isBypassEnabled()
// Let's improve this when we're merging the heights above && ambientState.isOnKeyguard() && !ambientState.isPulseExpanding();
stackBottom = ambientState.isPulseExpanding() final int stackBottom =
? (int) ambientState.getStackHeight() !ambientState.isShadeExpanded() || ambientState.isDozing()
: ambientState.getInnerHeight(); || bypassPulseNotExpanding
} else {
stackBottom = !ambientState.isShadeExpanded() || ambientState.isDozing()
? ambientState.getInnerHeight() ? ambientState.getInnerHeight()
: (int) ambientState.getPulseStackHeight(); : (int) ambientState.getStackHeight();
}
final int shelfStart = final int shelfStart =
stackBottom - ambientState.getShelf().getIntrinsicHeight(); stackBottom - ambientState.getShelf().getIntrinsicHeight();
viewState.yTranslation = Math.min(viewState.yTranslation, shelfStart); viewState.yTranslation = Math.min(viewState.yTranslation, shelfStart);