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

Commit 5c74f7bb authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Implement swipe up and quick scrub onboarding (Pt. Launcher)

SysUI change: ag/3914771

Bug: 70180942
Test: manual test
Change-Id: I42ade28ebad6dcbbcee6dfb80791f22f36e78290
parent 955a018d
Loading
Loading
Loading
Loading
+240 B (120 KiB)

File changed.

No diff preview for this file type.

+4 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import com.android.launcher3.LauncherState;
import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.util.SysuiEventLogger;

/**
@@ -19,6 +20,8 @@ import com.android.quickstep.util.SysuiEventLogger;
 */
public class LandscapeEdgeSwipeController extends AbstractStateChangeTouchController {

    private static final String TAG = "LandscapeEdgeSwipeCtrl";

    public LandscapeEdgeSwipeController(Launcher l) {
        super(l, SwipeDetector.HORIZONTAL);
    }
@@ -69,6 +72,7 @@ public class LandscapeEdgeSwipeController extends AbstractStateChangeTouchContro
    protected void onSwipeInteractionCompleted(LauncherState targetState, int logAction) {
        super.onSwipeInteractionCompleted(targetState, logAction);
        if (mFromState == NORMAL && targetState == OVERVIEW) {
            RecentsModel.getInstance(mLauncher).onOverviewShown(true, TAG);
            SysuiEventLogger.writeDummyRecentsTransition(0);
        }
    }
+4 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.TouchInteractionService;
import com.android.quickstep.util.SysuiEventLogger;
import com.android.quickstep.views.RecentsView;
@@ -49,6 +50,8 @@ import com.android.quickstep.views.TaskView;
 */
public class PortraitStatesTouchController extends AbstractStateChangeTouchController {

    private static final String TAG = "PortraitStatesTouchCtrl";

    private static final float TOTAL_DISTANCE_MULTIPLIER = 3f;
    private static final float LINEAR_SCALE_LIMIT = 1 / TOTAL_DISTANCE_MULTIPLIER;

@@ -284,6 +287,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
    protected void onSwipeInteractionCompleted(LauncherState targetState, int logAction) {
        super.onSwipeInteractionCompleted(targetState, logAction);
        if (mFromState == NORMAL && targetState == OVERVIEW) {
            RecentsModel.getInstance(mLauncher).onOverviewShown(true, TAG);
            SysuiEventLogger.writeDummyRecentsTransition(0);
        }
    }
+15 −0
Original line number Diff line number Diff line
@@ -26,8 +26,10 @@ import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.os.RemoteException;
import android.os.UserHandle;
import android.support.annotation.WorkerThread;
import android.util.Log;
import android.util.LruCache;
import android.util.SparseArray;
import android.view.accessibility.AccessibilityManager;
@@ -234,6 +236,19 @@ public class RecentsModel extends TaskStackChangeListener {
        mRecentsTaskLoader.onTrimMemory(level);
    }

    public void onOverviewShown(boolean fromHome, String tag) {
        if (mSystemUiProxy == null) {
            return;
        }
        try {
            mSystemUiProxy.onOverviewShown(fromHome);
        } catch (RemoteException e) {
            Log.w(tag,
                    "Failed to notify SysUI of overview shown from " + (fromHome ? "home" : "app")
                            + ": ", e);
        }
    }

    @WorkerThread
    public void preloadAssistData(int taskId, Bundle data) {
        mMainThreadExecutor.execute(() -> {
+1 −0
Original line number Diff line number Diff line
@@ -698,6 +698,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
            // If we haven't posted the transition end runnable, run it now
            finishTransitionRunnable.run();
        }
        RecentsModel.getInstance(mContext).onOverviewShown(false, TAG);
        doLogGesture(true /* toLauncher */);
    }