Loading packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,16 @@ flag { } } flag { name: "notification_fix_hun_shadows" namespace: "systemui" description: "Fix HUN shadows when the shade is collapsed." bug: "440572084" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "scene_container" namespace: "systemui" Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +7 −1 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import android.view.View import android.widget.FrameLayout import androidx.test.filters.SmallTest import com.android.keyguard.BouncerPanelExpansionCalculator.aboutToShowBouncerProgress import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.animation.ShadeInterpolation.getContentAlpha import com.android.systemui.dump.DumpManager Loading Loading @@ -117,7 +118,8 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { @JvmStatic @Parameters(name = "{0}") fun getParams(): List<FlagsParameterization> { return FlagsParameterization.allCombinationsOf().andSceneContainer() return FlagsParameterization.allCombinationsOf(Flags.FLAG_NOTIFICATION_FIX_HUN_SHADOWS) .andSceneContainer() } } Loading Loading @@ -1447,6 +1449,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { // Given: shade is opened, yTranslation of HUN is 0, // the height of HUN equals to the height of QQS Panel, // and HUN fully overlaps with QQS Panel ambientState.isShadeExpanded = true ambientState.stackTranslation = px(R.dimen.qqs_layout_margin_top) + px(R.dimen.qqs_layout_padding_bottom) val childHunView = Loading Loading @@ -1474,6 +1477,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { // Given: shade is opened, yTranslation of HUN is greater than 0, // the height of HUN is equal to the height of QQS Panel, // and HUN partially overlaps with QQS Panel ambientState.isShadeExpanded = true ambientState.stackTranslation = px(R.dimen.qqs_layout_margin_top) + px(R.dimen.qqs_layout_padding_bottom) val childHunView = Loading Loading @@ -1504,6 +1508,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { // Given: shade is opened, yTranslation of HUN is equal to QQS Panel's height, // the height of HUN is equal to the height of QQS Panel, // and HUN doesn't overlap with QQS Panel ambientState.isShadeExpanded = true ambientState.stackTranslation = px(R.dimen.qqs_layout_margin_top) + px(R.dimen.qqs_layout_padding_bottom) // Mock the height of shade Loading Loading @@ -1534,6 +1539,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { fun shadeClosed_hunShouldHaveFullShadow() { // Given: shade is closed, ambientState.stackTranslation == -ambientState.topPadding, // the height of HUN is equal to the height of QQS Panel, ambientState.isShadeExpanded = false ambientState.stackTranslation = (-ambientState.topPadding).toFloat() // Mock the height of shade ambientState.setLayoutMinHeight(1000) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +6 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.stack; import static com.android.systemui.Flags.notificationFixHunShadows; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; Loading Loading @@ -1305,7 +1307,7 @@ public class StackScrollAlgorithm { if (childrenOnTop != 0.0f) { // To elevate the later HUN over previous HUN when multiple HUNs exist childrenOnTop++; } else { } else if (ambientState.isShadeExpanded() || !notificationFixHunShadows()) { // Handles HUN shadow when Shade is opened, and AmbientState.mScrollY > 0 // Calculate the HUN's z-value based on its overlapping fraction with QQS Panel. // When scrolling down shade to make HUN back to in-position in Notif Panel, Loading @@ -1317,6 +1319,9 @@ public class StackScrollAlgorithm { 1.0f, overlap / childViewState.height ); } else { // Increment by one to add the full shadow when the shade is closed. childrenOnTop++; } childViewState.setZTranslation(baseZ + childrenOnTop * mPinnedZTranslationExtra); Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,16 @@ flag { } } flag { name: "notification_fix_hun_shadows" namespace: "systemui" description: "Fix HUN shadows when the shade is collapsed." bug: "440572084" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "scene_container" namespace: "systemui" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt +7 −1 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ import android.view.View import android.widget.FrameLayout import androidx.test.filters.SmallTest import com.android.keyguard.BouncerPanelExpansionCalculator.aboutToShowBouncerProgress import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.animation.ShadeInterpolation.getContentAlpha import com.android.systemui.dump.DumpManager Loading Loading @@ -117,7 +118,8 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { @JvmStatic @Parameters(name = "{0}") fun getParams(): List<FlagsParameterization> { return FlagsParameterization.allCombinationsOf().andSceneContainer() return FlagsParameterization.allCombinationsOf(Flags.FLAG_NOTIFICATION_FIX_HUN_SHADOWS) .andSceneContainer() } } Loading Loading @@ -1447,6 +1449,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { // Given: shade is opened, yTranslation of HUN is 0, // the height of HUN equals to the height of QQS Panel, // and HUN fully overlaps with QQS Panel ambientState.isShadeExpanded = true ambientState.stackTranslation = px(R.dimen.qqs_layout_margin_top) + px(R.dimen.qqs_layout_padding_bottom) val childHunView = Loading Loading @@ -1474,6 +1477,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { // Given: shade is opened, yTranslation of HUN is greater than 0, // the height of HUN is equal to the height of QQS Panel, // and HUN partially overlaps with QQS Panel ambientState.isShadeExpanded = true ambientState.stackTranslation = px(R.dimen.qqs_layout_margin_top) + px(R.dimen.qqs_layout_padding_bottom) val childHunView = Loading Loading @@ -1504,6 +1508,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { // Given: shade is opened, yTranslation of HUN is equal to QQS Panel's height, // the height of HUN is equal to the height of QQS Panel, // and HUN doesn't overlap with QQS Panel ambientState.isShadeExpanded = true ambientState.stackTranslation = px(R.dimen.qqs_layout_margin_top) + px(R.dimen.qqs_layout_padding_bottom) // Mock the height of shade Loading Loading @@ -1534,6 +1539,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() { fun shadeClosed_hunShouldHaveFullShadow() { // Given: shade is closed, ambientState.stackTranslation == -ambientState.topPadding, // the height of HUN is equal to the height of QQS Panel, ambientState.isShadeExpanded = false ambientState.stackTranslation = (-ambientState.topPadding).toFloat() // Mock the height of shade ambientState.setLayoutMinHeight(1000) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +6 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.notification.stack; import static com.android.systemui.Flags.notificationFixHunShadows; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; Loading Loading @@ -1305,7 +1307,7 @@ public class StackScrollAlgorithm { if (childrenOnTop != 0.0f) { // To elevate the later HUN over previous HUN when multiple HUNs exist childrenOnTop++; } else { } else if (ambientState.isShadeExpanded() || !notificationFixHunShadows()) { // Handles HUN shadow when Shade is opened, and AmbientState.mScrollY > 0 // Calculate the HUN's z-value based on its overlapping fraction with QQS Panel. // When scrolling down shade to make HUN back to in-position in Notif Panel, Loading @@ -1317,6 +1319,9 @@ public class StackScrollAlgorithm { 1.0f, overlap / childViewState.height ); } else { // Increment by one to add the full shadow when the shade is closed. childrenOnTop++; } childViewState.setZTranslation(baseZ + childrenOnTop * mPinnedZTranslationExtra); Loading