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

Commit 72d0847c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] Fix FooterView flicker when expanding/collapsing DualShade" into main

parents e53ecdbe dd33be25
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1110,6 +1110,21 @@ class StackScrollAlgorithmTest(flags: FlagsParameterization) : SysuiTestCase() {
        assertThat((footerView.viewState as FooterViewState).hideContent).isTrue()
    }

    @Test
    @EnableSceneContainer
    fun resetViewStates_noSpaceForFooterDuringExpansion_footerShown_withSceneContainer() {
        ambientState.isShadeExpanded = true
        ambientState.isExpansionChanging = true
        ambientState.stackTop = 0f
        ambientState.drawBounds = RectF(0f, 0f, 400f, 100f)
        val footerView = mockFooterView(height = 200) // no space for the footer in the stack
        hostView.addView(footerView)

        stackScrollAlgorithm.resetViewStates(ambientState, 0)

        assertThat((footerView.viewState as FooterViewState).hideContent).isFalse()
    }

    @Test
    fun resetViewStates_clearAllInProgress_hasNonClearableRow_footerVisible() {
        whenever(notificationRow.canViewBeCleared()).thenReturn(false)
+8 −6
Original line number Diff line number Diff line
@@ -714,12 +714,14 @@ public class StackScrollAlgorithm {
        );
        if (view instanceof FooterView) {
            if (SceneContainerFlag.isEnabled()) {
                if (!ambientState.isExpansionChanging()) {
                    final float footerEnd =
                            stackTop + viewState.getYTranslation() + view.getIntrinsicHeight();
                    final boolean noSpaceForFooter = footerEnd > ambientState.getStackCutoff();
                    ((FooterView.FooterViewState) viewState).hideContent =
                            noSpaceForFooter || (ambientState.isClearAllInProgress()
                                    && !hasNonClearableNotifs(algorithmState));
                }
            } else {
                // TODO(b/333445519): shouldBeHidden should reflect whether the shade is closed
                //  already, so we shouldn't need to use ambientState here. However,