Fix notification top clipping

Test: scroll through notifications on shade locked and shade
Fixes: 185683835
Change-Id: I7b104a98565cf7bb85190f69d042d9fd592f721c
This commit is contained in:
Lucas Dupin
2021-04-26 16:38:54 -07:00
parent a80a2548ca
commit 6f97c0a8bf

View File

@@ -153,9 +153,7 @@ public class StackScrollAlgorithm {
private void updateClipping(StackScrollAlgorithmState algorithmState,
AmbientState ambientState) {
float drawStart = !ambientState.isOnKeyguard() ? ambientState.getTopPadding()
+ ambientState.getStackTranslation()
: 0;
float drawStart = !ambientState.isOnKeyguard() ? ambientState.getStackY() : 0;
float clipStart = 0;
int childCount = algorithmState.visibleChildren.size();
boolean firstHeadsUp = true;
@@ -168,8 +166,7 @@ public class StackScrollAlgorithm {
float newYTranslation = state.yTranslation;
float newHeight = state.height;
float newNotificationEnd = newYTranslation + newHeight;
boolean isHeadsUp = (child instanceof ExpandableNotificationRow)
&& ((ExpandableNotificationRow) child).isPinned();
boolean isHeadsUp = (child instanceof ExpandableNotificationRow) && child.isPinned();
if (mClipNotificationScrollToTop
&& (!state.inShelf || (isHeadsUp && !firstHeadsUp))
&& newYTranslation < clipStart