Merge "Fix fickle footer visibility" into sc-dev am: ab2dd81796

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

Change-Id: Ic26b1762c3b7b288c7b95f0a2677c7f71c8e05e5
This commit is contained in:
Lyn Han
2021-05-13 22:27:12 +00:00
committed by Automerger Merge Worker

View File

@@ -664,7 +664,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
mDebugPaint.setColor(Color.CYAN);
canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
y = (int) (mAmbientState.getStackY() + mSidePaddings + mAmbientState.getStackHeight());
y = (int) (mAmbientState.getStackY() + mAmbientState.getStackHeight());
mDebugPaint.setColor(Color.BLUE);
canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
}
@@ -1151,7 +1151,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
if (mQsExpansionFraction <= 0) {
final float scrimTopPadding = mAmbientState.isOnKeyguard() ? 0 : mSidePaddings;
final float stackEndHeight = Math.max(0f,
getHeight() - getEmptyBottomMargin() - stackY - scrimTopPadding);
getHeight() - getEmptyBottomMargin() - stackY);
mAmbientState.setStackEndHeight(stackEndHeight);
mAmbientState.setStackHeight(
MathUtils.lerp(stackEndHeight * StackScrollAlgorithm.START_FRACTION,
@@ -2068,18 +2068,22 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
@ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
private void updateContentHeight() {
int height = 0;
final float scrimTopPadding = mAmbientState.isOnKeyguard() ? 0 : mSidePaddings;
int height = (int) scrimTopPadding;
float previousPaddingRequest = mPaddingBetweenElements;
int numShownItems = 0;
int numShownNotifs = 0;
boolean finish = false;
int maxDisplayedNotifications = mMaxDisplayedNotifications;
ExpandableView previousView = null;
for (int i = 0; i < getChildCount(); i++) {
ExpandableView expandableView = (ExpandableView) getChildAt(i);
boolean footerViewOnLockScreen = expandableView == mFooterView && onKeyguard();
if (expandableView.getVisibility() != View.GONE
&& !expandableView.hasNoContentHeight() && !footerViewOnLockScreen) {
boolean limitReached = maxDisplayedNotifications != -1
&& numShownNotifs >= maxDisplayedNotifications;
final float viewHeight;