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

Commit 4fe3e475 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed bugs in the stack scroller

- A hole could occur when collapsing and expanding in the same touch
- The second card was not correctly resized if the stack was scrolled

Bug: 15996450
Change-Id: Ie779ed5d63b8c55d490c459955bafbc583bfce97
parent 96aacd2a
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -1800,14 +1800,14 @@ public class NotificationStackScrollLayout extends ViewGroup
    public void onExpansionStopped() {
    public void onExpansionStopped() {
        mIsExpansionChanging = false;
        mIsExpansionChanging = false;
        mStackScrollAlgorithm.onExpansionStopped();
        mStackScrollAlgorithm.onExpansionStopped();
        if (!mIsExpanded) {
            mOwnScrollY = 0;
        }
    }
    }


    private void setIsExpanded(boolean isExpanded) {
    private void setIsExpanded(boolean isExpanded) {
        mIsExpanded = isExpanded;
        mIsExpanded = isExpanded;
        mStackScrollAlgorithm.setIsExpanded(isExpanded);
        mStackScrollAlgorithm.setIsExpanded(isExpanded);
        if (!isExpanded) {
            mOwnScrollY = 0;
        }
    }
    }


    @Override
    @Override
+4 −0
Original line number Original line Diff line number Diff line
@@ -399,6 +399,10 @@ public class StackScrollAlgorithm {
            if (i == 0) {
            if (i == 0) {
                childViewState.alpha = 1.0f;
                childViewState.alpha = 1.0f;
                childViewState.yTranslation = Math.max(mCollapsedSize - algorithmState.scrollY, 0);
                childViewState.yTranslation = Math.max(mCollapsedSize - algorithmState.scrollY, 0);
                if (childViewState.yTranslation + childViewState.height > bottomPeekStart) {
                    childViewState.height = (int) Math.max(
                            bottomPeekStart - childViewState.yTranslation, mCollapsedSize);
                }
                childViewState.location = StackScrollState.ViewState.LOCATION_FIRST_CARD;
                childViewState.location = StackScrollState.ViewState.LOCATION_FIRST_CARD;
            }
            }
            if (childViewState.location == StackScrollState.ViewState.LOCATION_UNKNOWN) {
            if (childViewState.location == StackScrollState.ViewState.LOCATION_UNKNOWN) {