summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java28
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java4
2 files changed, 22 insertions, 10 deletions
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 f02f7f736668..57af8ea19722 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
@@ -797,7 +797,7 @@ public class NotificationStackScrollLayout
&& !onKeyguard()
&& mUpcomingStatusBarState != StatusBarState.KEYGUARD
// quick settings don't affect notifications when not in full screen
- && (mQsExpansionFraction != 1 || !mQsFullScreen)
+ && (getQsExpansionFraction() != 1 || !mQsFullScreen)
&& !mScreenOffAnimationController.shouldHideNotificationsFooter()
&& !mIsRemoteInputActive;
}
@@ -1528,7 +1528,7 @@ public class NotificationStackScrollLayout
float fraction = mAmbientState.getExpansionFraction();
// If we are on quick settings, we need to quickly hide it to show the bouncer to avoid an
// overlap. Otherwise, we maintain the normal fraction for smoothness.
- if (mAmbientState.isBouncerInTransit() && mQsExpansionFraction > 0f) {
+ if (mAmbientState.isBouncerInTransit() && getQsExpansionFraction() > 0f) {
fraction = BouncerPanelExpansionCalculator.aboutToShowBouncerProgress(fraction);
}
final float stackY = MathUtils.lerp(0, endTopPosition, fraction);
@@ -1552,7 +1552,7 @@ public class NotificationStackScrollLayout
}
updateInterpolatedStackHeight(endHeight, fraction);
} else {
- if (mQsExpansionFraction <= 0 && !shouldSkipHeightUpdate()) {
+ if (getQsExpansionFraction() <= 0 && !shouldSkipHeightUpdate()) {
final float endHeight = updateStackEndHeight(
getHeight(), getEmptyBottomMarginInternal(), getTopPadding());
updateInterpolatedStackHeight(endHeight, fraction);
@@ -1705,7 +1705,7 @@ public class NotificationStackScrollLayout
stackHeight = (int) height;
} else {
stackHeight = (int) NotificationUtils.interpolate(stackStartPosition,
- stackEndPosition, mQsExpansionFraction);
+ stackEndPosition, getQsExpansionFraction());
}
}
} else {
@@ -5271,17 +5271,22 @@ public class NotificationStackScrollLayout
return mQsFullScreen;
}
+ private float getQsExpansionFraction() {
+ SceneContainerFlag.assertInLegacyMode();
+ return mQsExpansionFraction;
+ }
+
public void setQsExpansionFraction(float qsExpansionFraction) {
SceneContainerFlag.assertInLegacyMode();
- boolean footerAffected = mQsExpansionFraction != qsExpansionFraction
- && (mQsExpansionFraction == 1 || qsExpansionFraction == 1);
+ boolean footerAffected = getQsExpansionFraction() != qsExpansionFraction
+ && (getQsExpansionFraction() == 1 || qsExpansionFraction == 1);
mQsExpansionFraction = qsExpansionFraction;
updateUseRoundedRectClipping();
// If notifications are scrolled,
// clear out scrollY by the time we push notifications offscreen
if (getOwnScrollY() > 0) {
- setOwnScrollY((int) MathUtils.lerp(getOwnScrollY(), 0, mQsExpansionFraction));
+ setOwnScrollY((int) MathUtils.lerp(getOwnScrollY(), 0, getQsExpansionFraction()));
}
if (!FooterViewRefactor.isEnabled() && footerAffected) {
updateFooter();
@@ -5514,7 +5519,6 @@ public class NotificationStackScrollLayout
println(pw, "suppressChildrenMeasureLayout", mSuppressChildrenMeasureAndLayout);
println(pw, "scrollY", mAmbientState.getScrollY());
println(pw, "showShelfOnly", mShouldShowShelfOnly);
- println(pw, "qsExpandFraction", mQsExpansionFraction);
println(pw, "isCurrentUserSetup", mIsCurrentUserSetup);
println(pw, "hideAmount", mAmbientState.getHideAmount());
println(pw, "ambientStateSwipingUp", mAmbientState.isSwipingUp());
@@ -5550,6 +5554,7 @@ public class NotificationStackScrollLayout
println(pw, "contentHeight", getContentHeight());
println(pw, "topPadding", getTopPadding());
println(pw, "maxTopPadding", getMaxTopPadding());
+ println(pw, "qsExpandFraction", getQsExpansionFraction());
}
});
pw.println();
@@ -5622,7 +5627,9 @@ public class NotificationStackScrollLayout
pw.println("mIsCurrentUserSetup: " + mIsCurrentUserSetup);
pw.println("onKeyguard: " + onKeyguard());
pw.println("mUpcomingStatusBarState: " + mUpcomingStatusBarState);
- pw.println("mQsExpansionFraction: " + mQsExpansionFraction);
+ if (!SceneContainerFlag.isEnabled()) {
+ pw.println("QsExpansionFraction: " + getQsExpansionFraction());
+ }
pw.println("mQsFullScreen: " + mQsFullScreen);
pw.println(
"mScreenOffAnimationController"
@@ -6246,7 +6253,8 @@ public class NotificationStackScrollLayout
if (SceneContainerFlag.isEnabled()) return;
// We don't want to clip notifications when QS is expanded, because incoming heads up on
// the bottom would be clipped otherwise
- boolean qsAllowsClipping = mQsExpansionFraction < 0.5f || mShouldUseSplitNotificationShade;
+ boolean qsAllowsClipping =
+ getQsExpansionFraction() < 0.5f || mShouldUseSplitNotificationShade;
boolean clip = mIsExpanded && qsAllowsClipping;
if (clip != mShouldUseRoundedRectClipping) {
mShouldUseRoundedRectClipping = clip;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
index 57fad83da8b9..6069b4409ec9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
@@ -610,6 +610,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
@Test
@DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME})
+ @DisableSceneContainer
public void testUpdateFooter_remoteInput() {
setBarStateForTest(StatusBarState.SHADE);
mStackScroller.setCurrentUserSetup(true);
@@ -643,6 +644,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
@Test
@DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME})
+ @DisableSceneContainer
public void testUpdateFooter_oneClearableNotification() {
setBarStateForTest(StatusBarState.SHADE);
mStackScroller.setCurrentUserSetup(true);
@@ -659,6 +661,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
@Test
@DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME})
+ @DisableSceneContainer
public void testUpdateFooter_withoutHistory() {
setBarStateForTest(StatusBarState.SHADE);
mStackScroller.setCurrentUserSetup(true);
@@ -692,6 +695,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
@Test
@DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME})
+ @DisableSceneContainer
public void testUpdateFooter_oneNonClearableNotification() {
setBarStateForTest(StatusBarState.SHADE);
mStackScroller.setCurrentUserSetup(true);