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

Commit d2ec22c3 authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Handle swipe up after quick switch in overview grid" into sc-dev

parents 6460e678 f4cf80ea
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -966,6 +966,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            if (mRecentsView != null) {
                int nearestPage = mRecentsView.getDestinationPage();
                boolean isScrolling = false;
                // Update page scroll before snapping to page to make sure we snapped to the
                // position calculated with target gesture in mind.
                mRecentsView.updateScrollSynchronously();
                if (mRecentsView.getNextPage() != nearestPage) {
                    // We shouldn't really scroll to the next page when swiping up to recents.
                    // Only allow settling on the next page if it's nearest to the center.
+14 −5
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.quickstep.fallback;

import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS;
import static com.android.quickstep.fallback.RecentsState.DEFAULT;
import static com.android.quickstep.fallback.RecentsState.HOME;
import static com.android.quickstep.fallback.RecentsState.MODAL_TASK;

import android.annotation.TargetApi;
@@ -97,6 +98,15 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
        }
    }

    @Override
    public void onGestureAnimationEnd() {
        if (mCurrentGestureEndTarget == GestureState.GestureEndTarget.HOME) {
            // Clean-up logic that occurs when recents is no longer in use/visible.
            reset();
        }
        super.onGestureAnimationEnd();
    }

    @Override
    public void setCurrentTask(int runningTaskId) {
        super.setCurrentTask(runningTaskId);
@@ -155,11 +165,6 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
        super.setRunningTaskHidden(isHidden);
    }

    @Override
    protected boolean isHomeTask(TaskView taskView) {
        return mHomeTaskInfo != null && taskView.hasTaskId(mHomeTaskInfo.taskId);
    }

    @Override
    public void setModalStateEnabled(boolean isModalState) {
        super.setModalStateEnabled(isModalState);
@@ -182,6 +187,10 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta

    @Override
    public void onStateTransitionComplete(RecentsState finalState) {
        if (finalState == HOME) {
            // Clean-up logic that occurs when recents is no longer in use/visible.
            reset();
        }
        setOverlayEnabled(finalState == DEFAULT || finalState == MODAL_TASK);
        setFreezeViewVisibility(false);
    }
+3 −3
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ public class ClearAllButton extends Button {
        }
    }

    public void onRecentsViewScroll(int scrollFromEdge, boolean gridEnabled) {
    public void onRecentsViewScroll(int scroll, boolean gridEnabled) {
        RecentsView recentsView = getRecentsView();
        if (recentsView == null) {
            return;
@@ -109,8 +109,8 @@ public class ClearAllButton extends Button {
            return;
        }

        int leftEdgeScroll = recentsView.getLeftMostChildScroll();
        int adjustedScrollFromEdge = scrollFromEdge - leftEdgeScroll;
        int clearAllScroll = recentsView.getClearAllScroll();
        int adjustedScrollFromEdge = Math.abs(scroll - clearAllScroll);
        float shift = Math.min(adjustedScrollFromEdge, orientationSize);
        mNormalTranslationPrimary = mIsRtl ? -shift : shift;
        if (!gridEnabled) {
+184 −107

File changed.

Preview size limit exceeded, changes collapsed.

+21 −8

File changed.

Preview size limit exceeded, changes collapsed.