summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java5
3 files changed, 13 insertions, 3 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
index 08ecbac1582c..41cca19346f0 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
@@ -38,6 +38,7 @@ import com.android.systemui.statusbar.ui.fakeSystemBarUtilsProxy
import com.android.systemui.testKosmos
import com.google.common.truth.Expect
import com.google.common.truth.Truth.assertThat
+import kotlin.math.roundToInt
import org.junit.Assume
import org.junit.Before
import org.junit.Rule
@@ -1572,7 +1573,11 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() {
fullStackHeight: Float = 3000f,
) {
ambientState.headsUpTop = headsUpTop
- ambientState.headsUpBottom = headsUpBottom
+ if (NotificationsHunSharedAnimationValues.isEnabled) {
+ headsUpAnimator.headsUpAppearHeightBottom = headsUpBottom.roundToInt()
+ } else {
+ ambientState.headsUpBottom = headsUpBottom
+ }
ambientState.stackTop = stackTop
ambientState.stackCutoff = stackCutoff
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
index 1e249520e8b3..abfb86244390 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java
@@ -36,13 +36,14 @@ import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.data.repository.HeadsUpRepository;
+import com.android.systemui.statusbar.notification.headsup.AvalancheController;
+import com.android.systemui.statusbar.notification.headsup.NotificationsHunSharedAnimationValues;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.ExpandableView;
import com.android.systemui.statusbar.notification.shared.NotificationBundleUi;
import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.BypassController;
import com.android.systemui.statusbar.notification.stack.StackScrollAlgorithm.SectionProvider;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
-import com.android.systemui.statusbar.notification.headsup.AvalancheController;
import java.io.PrintWriter;
@@ -424,6 +425,7 @@ public class AmbientState implements Dumpable {
/** the bottom-most y position where we can draw pinned HUNs */
public float getHeadsUpBottom() {
if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0f;
+ NotificationsHunSharedAnimationValues.assertInLegacyMode();
return mHeadsUpBottom;
}
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 d23a4c6307fc..28218227506c 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
@@ -967,9 +967,12 @@ public class StackScrollAlgorithm {
childState.setZTranslation(baseZ);
}
if (isTopEntry && row.isAboveShelf()) {
+ float headsUpBottom = NotificationsHunSharedAnimationValues.isEnabled()
+ ? mHeadsUpAnimator.getHeadsUpAppearHeightBottom()
+ : ambientState.getHeadsUpBottom();
clampHunToMaxTranslation(
/* headsUpTop = */ headsUpTranslation,
- /* headsUpBottom = */ ambientState.getHeadsUpBottom(),
+ /* headsUpBottom = */ headsUpBottom,
/* viewState = */ childState
);
updateCornerRoundnessForPinnedHun(row, ambientState.getStackTop());