Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f3115cd authored by András Kurucz's avatar András Kurucz
Browse files

[Flexiglass] Fix FooterView flicker when collapsing any shade

When the shade collapses, there is a slight gap between finalizing the
fade out animation of the Footer, and hiding the SceneWindowRootView.
The problem is that after the shade expand/collapse has finished, the
FooterView is resetted to a default state with the  alpha of 1f. This is
causing a flicker.

Somehow the FooterView is the only child of the NSSL, that receives a
visible alpha in this state, so this CL brings it in parity with the
others.

Fixes: 439516450
Test: expand/collapse SingleShade -> look for FooterView flickers
Flag: com.android.systemui.scene_container
Change-Id: Ia64d78e507a96741ce296c99e50a6a1cc71515fc
parent e42f3d9b
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -141,8 +141,7 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() {
        hostView.addView(notificationRow)

        headsUpAnimator = HeadsUpAnimator(context, kosmos.fakeSystemBarUtilsProxy)
        stackScrollAlgorithm =
            StackScrollAlgorithm(context, hostView, headsUpAnimator)
        stackScrollAlgorithm = StackScrollAlgorithm(context, hostView, headsUpAnimator)
    }

    private fun isTv(): Boolean {
@@ -981,6 +980,19 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() {
        assertThat(notificationRow.viewState.alpha).isEqualTo(1f - ambientState.hideAmount)
    }

    @Test
    @EnableSceneContainer
    fun resetViewStates_shadeCollapsed_footerViewBecomesTransparent() {
        ambientState.expansionFraction = 0f
        stackScrollAlgorithm.initView(context)
        hostView.removeAllViews()
        hostView.addView(footerView)

        stackScrollAlgorithm.resetViewStates(ambientState, /* speedBumpIndex= */ 0)

        assertThat(footerView.viewState.alpha).isEqualTo(0f)
    }

    @Test
    fun resetViewStates_isOnKeyguard_emptyShadeViewBecomesTransparent() {
        ambientState.setStatusBarState(StatusBarState.KEYGUARD)
+4 −3
Original line number Diff line number Diff line
@@ -200,9 +200,10 @@ public class StackScrollAlgorithm {

            // On the final call to {@link #resetViewState}, the alpha is set back to 1f but
            // ambientState.isExpansionChanging() is now false. This causes a flicker on the
            // EmptyShadeView after the shade is collapsed. Make sure the empty shade view
            // isn't visible unless the shade is expanded.
            if (view instanceof EmptyShadeView && ambientState.getExpansionFraction() == 0f) {
            // EmptyShadeView or the FooterView after the shade is collapsed. Make sure these views
            // aren't visible unless the shade is expanded.
            if (ambientState.getExpansionFraction() == 0f && ((view instanceof EmptyShadeView) || (
                    SceneContainerFlag.isEnabled() && view instanceof FooterView))) {
                viewState.setAlpha(0f);
            }