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

Commit 3a22956f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove overscroll on running task when it's not attached to...

Merge "Remove overscroll on running task when it's not attached to RecentsView" into ub-launcher3-rvc-qpr-dev
parents ce8b2b51 3af714f0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -488,6 +488,16 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte
            recentsAttachedToAppWindow = mIsShelfPeeking || mIsLikelyToStartNewTask;
        }
        mAnimationFactory.setRecentsAttachedToAppWindow(recentsAttachedToAppWindow, animate);

        // Reapply window transform throughout the attach animation, as the animation affects how
        // much the window is bound by overscroll (vs moving freely).
        if (animate) {
            ValueAnimator reapplyWindowTransformAnim = ValueAnimator.ofFloat(0, 1);
            reapplyWindowTransformAnim.addUpdateListener(anim -> applyWindowTransform());
            reapplyWindowTransformAnim.setDuration(RECENTS_ATTACH_DURATION).start();
        } else {
            applyWindowTransform();
        }
    }

    @Override
+8 −1
Original line number Diff line number Diff line
@@ -2315,7 +2315,14 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
        if (pageIndex == -1) {
            return 0;
        }
        return getScrollForPage(pageIndex) - mOrientationHandler.getPrimaryScroll(this);
        // Unbound the scroll (due to overscroll) if the adjacent tasks are offset away from it.
        // This allows the page to move freely, given there's no visual indication why it shouldn't.
        int boundedScroll = mOrientationHandler.getPrimaryScroll(this);
        int unboundedScroll = getUnboundedScroll();
        float unboundedProgress = mAdjacentPageOffset;
        int scroll = Math.round(unboundedScroll * unboundedProgress
                + boundedScroll * (1 - unboundedProgress));
        return getScrollForPage(pageIndex) - scroll;
    }

    public Consumer<MotionEvent> getEventDispatcher(float navbarRotation) {