commit | bc014c2d3d03f7ed72325dfc6b8780592c145ef1 | [log] [tgz] |
---|---|---|
author | Lyn Han <lynhan@google.com> | Tue Jun 15 16:05:21 2021 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Tue Jun 15 16:05:21 2021 +0000 |
tree | e758e77ad765c28bf4602276266d66a1a282df27 | |
parent | b6afc7575c8d0cc4c053170567190aacf8fff0cc [diff] | |
parent | 7ff423028ada83b525ca18229002c51638be1759 [diff] |
Merge "Enable QS open while notifications are scrolled below status bar" into sc-dev
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 8277fae..f90b4c0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -4550,6 +4550,12 @@ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setQsExpansionFraction(float qsExpansionFraction) { mQsExpansionFraction = qsExpansionFraction; + + // If notifications are scrolled, + // clear out scrollY by the time we push notifications offscreen + if (mOwnScrollY > 0) { + setOwnScrollY((int) MathUtils.lerp(mOwnScrollY, 0, mQsExpansionFraction)); + } } @ShadeViewRefactor(RefactorComponent.COORDINATOR)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index b3569d0..4a7534d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -2200,8 +2200,9 @@ } private void updateQSExpansionEnabledAmbient() { + final float scrollRangeToTop = mAmbientState.getTopPadding() - mQuickQsOffsetHeight; mQsExpansionEnabledAmbient = - mAmbientState.getScrollY() <= 0 && !mAmbientState.isShadeOpening(); + mAmbientState.getScrollY() <= scrollRangeToTop && !mAmbientState.isShadeOpening(); setQsExpansionEnabled(); }