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

Commit 2e5a3fac authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug where the first notification was cut off

When dragging down on the lockscreen, the first notification
would be cut off.

Test: drag down on a single notification on the lockscreen
Bug: 32437839
Change-Id: I4796661e63a94e598e5489377d7ecd67b35e6e88
parent c9c640fd
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -350,7 +350,8 @@ public class StackScrollAlgorithm {
        boolean belowShelf = i >= ambientState.getShelfIndex();
        boolean isDismissView = child instanceof DismissView;
        if (i == 0) {
            updateFirstChildHeight(child, childViewState, childHeight, ambientState, belowShelf);
            updateFirstChildHeight(child, childViewState, childHeight, algorithmState, ambientState,
                    belowShelf);
        }

        // The y position after this element
@@ -584,11 +585,13 @@ public class StackScrollAlgorithm {
     * @param child the child to update
     * @param childViewState the viewstate of the child
     * @param childHeight the height of the child
     * @param algorithmState the algorithm state
     * @param ambientState The ambient state of the algorithm
     * @param belowShelf
     * @param belowShelf whether it is below the shelf
     */
    protected void updateFirstChildHeight(ExpandableView child, ExpandableViewState childViewState,
            int childHeight, AmbientState ambientState, boolean belowShelf) {
            int childHeight, StackScrollAlgorithmState algorithmState,
            AmbientState ambientState, boolean belowShelf) {

        int bottomStart;
        if (belowShelf) {
@@ -596,8 +599,11 @@ public class StackScrollAlgorithm {
            bottomStart = ambientState.getInnerHeight() - mBottomStackPeekSize -
                    mBottomStackSlowDownLength;
        } else {
            bottomStart = ambientState.getInnerHeight()
                    - ambientState.getShelf().getIntrinsicHeight() - mPaddingBetweenElements;
            bottomStart = ambientState.getInnerHeight();
            if (algorithmState.visibleChildren.size() > 1) {
                bottomStart -= ambientState.getShelf().getIntrinsicHeight()
                        - mPaddingBetweenElements;
            }
        }
        bottomStart += ambientState.getScrollY();
            // Collapse and expand the first child while the shade is being expanded