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

Commit 1ced59ac authored by Alex Chau's avatar Alex Chau Committed by Automerger Merge Worker
Browse files

Allow snapping to focused task in overview grid am: b6ad9dfa am: 17a0eec0

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16378986

Change-Id: Id925b44f6a324e821150efe1b3e1cc001497c69e
parents d35c6f97 17a0eec0
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1264,7 +1264,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
    @Override
    protected void onNotSnappingToPageInFreeScroll() {
        int finalPos = mScroller.getFinalX();
        if (!showAsGrid() && finalPos > mMinScroll && finalPos < mMaxScroll) {
        if (finalPos > mMinScroll && finalPos < mMaxScroll) {
            int firstPageScroll = getScrollForPage(!mIsRtl ? 0 : getPageCount() - 1);
            int lastPageScroll = getScrollForPage(!mIsRtl ? getPageCount() - 1 : 0);

@@ -1278,6 +1278,16 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                            ? mMaxScroll
                            : getScrollForPage(mNextPage);

            if (showAsGrid()) {
                TaskView taskView = getTaskViewAt(mNextPage);
                // Only snap to fully visible focused task.
                if (taskView == null
                        || !taskView.isFocusedTask()
                        || !isTaskViewFullyVisible(taskView)) {
                    return;
                }
            }

            mScroller.setFinalX(pageSnapped);
            // Ensure the scroll/snap doesn't happen too fast;
            int extraScrollDuration = OVERSCROLL_PAGE_SNAP_ANIMATION_DURATION