diff options
2 files changed, 8 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt index aff4a6759a47..2077d733172d 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt @@ -88,9 +88,9 @@ class FooterActionsViewModel( /** Called when the expansion of the Quick Settings changed. */ fun onQuickSettingsExpansionChanged(expansion: Float, isInSplitShade: Boolean) { if (isInSplitShade) { - // In split shade, we want to fade in the background only at the very end (see - // b/240563302). - val delay = 0.99f + // In split shade, we want to fade in the background when the QS background starts to + // show. + val delay = 0.15f _alpha.value = expansion _backgroundAlpha.value = max(0f, expansion - delay) / (1f - delay) } else { diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt index c7118066a276..1cb3bf6c7100 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt @@ -393,23 +393,23 @@ class FooterActionsViewModelTest : SysuiTestCase() { } @Test - fun backgroundAlpha_inSplitShade_followsExpansion_with_0_99_delay() { + fun backgroundAlpha_inSplitShade_followsExpansion_with_0_15_delay() { val underTest = utils.footerActionsViewModel() val floatTolerance = 0.01f underTest.onQuickSettingsExpansionChanged(0f, isInSplitShade = true) assertThat(underTest.backgroundAlpha.value).isEqualTo(0f) - underTest.onQuickSettingsExpansionChanged(0.5f, isInSplitShade = true) + underTest.onQuickSettingsExpansionChanged(0.1f, isInSplitShade = true) assertThat(underTest.backgroundAlpha.value).isEqualTo(0f) - underTest.onQuickSettingsExpansionChanged(0.9f, isInSplitShade = true) + underTest.onQuickSettingsExpansionChanged(0.14f, isInSplitShade = true) assertThat(underTest.backgroundAlpha.value).isEqualTo(0f) - underTest.onQuickSettingsExpansionChanged(0.991f, isInSplitShade = true) + underTest.onQuickSettingsExpansionChanged(0.235f, isInSplitShade = true) assertThat(underTest.backgroundAlpha.value).isWithin(floatTolerance).of(0.1f) - underTest.onQuickSettingsExpansionChanged(0.995f, isInSplitShade = true) + underTest.onQuickSettingsExpansionChanged(0.575f, isInSplitShade = true) assertThat(underTest.backgroundAlpha.value).isWithin(floatTolerance).of(0.5f) underTest.onQuickSettingsExpansionChanged(1f, isInSplitShade = true) |