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

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

Merge "[flexiglass] Fix footer not appearing on the locked shade" into main

parents 402468a3 73bfdd9e
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -677,23 +677,31 @@ public class StackScrollAlgorithm {
        );
        if (view instanceof FooterView) {
            if (FooterViewRefactor.isEnabled()) {
                if (SceneContainerFlag.isEnabled()) {
                    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, currently it
                //  doesn't get updated quickly enough and can cause the footer to flash when
                //  closing the shade. As such, we temporarily also check the ambientState directly.
                    //  already, so we shouldn't need to use ambientState here. However,
                    //  currently it doesn't get updated quickly enough and can cause the footer to
                    //  flash when closing the shade. As such, we temporarily also check the
                    //  ambientState directly.
                    if (((FooterView) view).shouldBeHidden() || !ambientState.isShadeExpanded()) {
                    // Note: This is no longer necessary in flexiglass.
                    if (!SceneContainerFlag.isEnabled()) {
                        viewState.hidden = true;
                    }
                    } else {
                        final float footerEnd = algorithmState.mCurrentExpandedYPosition
                                + view.getIntrinsicHeight();
                    final boolean noSpaceForFooter = footerEnd > ambientState.getStackEndHeight();
                        final boolean noSpaceForFooter =
                                footerEnd > ambientState.getStackEndHeight();
                        ((FooterView.FooterViewState) viewState).hideContent =
                                noSpaceForFooter || (ambientState.isClearAllInProgress()
                                        && !hasNonClearableNotifs(algorithmState));
                    }
                }
            } else {
                final boolean shadeClosed = !ambientState.isShadeExpanded();
                final boolean isShelfShowing = algorithmState.firstViewInShelf != null;