diff options
| author | 2019-07-19 00:09:53 +0000 | |
|---|---|---|
| committer | 2019-07-19 00:09:53 +0000 | |
| commit | 5e1a2df8348b8b5e2d75d46a403767d2b5119510 (patch) | |
| tree | 3ae8b44d200187a54ffa1de6d3c1f9b489b0434c | |
| parent | f41cc30658f25f19b1d7c8607e74df424eb98d33 (diff) | |
| parent | 8f3f03f1bfee3e4fe5e38e503285f3b23731c834 (diff) | |
Merge "Fixed an issue where heads up notifications would overlap" into qt-r1-dev
2 files changed, 11 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java index cc1170f7409b..b444fa50a253 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java @@ -83,6 +83,11 @@ public class SectionHeaderView extends ActivatableNotificationView { bindContents(); } + @Override + public boolean isTransparent() { + return true; + } + /** Must be called whenever the UI mode changes (i.e. when we enter night mode). */ void onUiModeChanged() { updateBackgroundColors(); 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 01e2b28600db..7655056ea60b 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 @@ -159,15 +159,13 @@ public class StackScrollAlgorithm { float drawStart = !ambientState.isOnKeyguard() ? ambientState.getTopPadding() + ambientState.getStackTranslation() + ambientState.getExpandAnimationTopChange() : 0; - float previousNotificationEnd = 0; - float previousNotificationStart = 0; + float clipStart = 0; int childCount = algorithmState.visibleChildren.size(); for (int i = 0; i < childCount; i++) { ExpandableView child = algorithmState.visibleChildren.get(i); ExpandableViewState state = child.getViewState(); if (!child.mustStayOnScreen() || state.headsUpIsVisible) { - previousNotificationEnd = Math.max(drawStart, previousNotificationEnd); - previousNotificationStart = Math.max(drawStart, previousNotificationStart); + clipStart = Math.max(drawStart, clipStart); } float newYTranslation = state.yTranslation; float newHeight = state.height; @@ -175,10 +173,10 @@ public class StackScrollAlgorithm { boolean isHeadsUp = (child instanceof ExpandableNotificationRow) && ((ExpandableNotificationRow) child).isPinned(); if (mClipNotificationScrollToTop - && !state.inShelf && newYTranslation < previousNotificationEnd - && (!isHeadsUp || ambientState.isShadeExpanded())) { + && (!state.inShelf || isHeadsUp) + && newYTranslation < clipStart) { // The previous view is overlapping on top, clip! - float overlapAmount = previousNotificationEnd - newYTranslation; + float overlapAmount = clipStart - newYTranslation; state.clipTopAmount = (int) overlapAmount; } else { state.clipTopAmount = 0; @@ -187,8 +185,7 @@ public class StackScrollAlgorithm { if (!child.isTransparent()) { // Only update the previous values if we are not transparent, // otherwise we would clip to a transparent view. - previousNotificationEnd = newNotificationEnd; - previousNotificationStart = newYTranslation; + clipStart = Math.max(clipStart, isHeadsUp ? newYTranslation : newNotificationEnd); } } } |