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

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

Merge "Making navigation mode listener a singleton so that the change is...

Merge "Making navigation mode listener a singleton so that the change is dispatched everywhere synchronously." into ub-launcher3-master
parents f74882d9 5743f863
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ android_library {
    ],
    srcs: [
        "tests/tapl/**/*.java",
        "quickstep/src/com/android/quickstep/SwipeUpSetting.java",
        "src/com/android/launcher3/util/SecureSettingsObserver.java",
        "src/com/android/launcher3/TestProtocol.java",
    ],
+3 −3
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import com.android.launcher3.uioverrides.touchcontrollers.LandscapeStatesTouchCo
import com.android.launcher3.uioverrides.touchcontrollers.PortraitStatesTouchController;
import com.android.launcher3.uioverrides.touchcontrollers.StatusBarTouchController;
import com.android.launcher3.util.TouchController;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.views.IconRecentsView;

import java.util.ArrayList;
@@ -52,8 +52,8 @@ public abstract class RecentsUiFactory {
            list.add(new LandscapeStatesTouchController(launcher));
            list.add(new LandscapeEdgeSwipeController(launcher));
        } else {
            boolean allowDragToOverview = OverviewInteractionState.INSTANCE.get(launcher)
                    .isSwipeUpGestureEnabled();
            boolean allowDragToOverview = SysUINavigationMode.INSTANCE.get(launcher)
                    .getMode().hasGestures;
            list.add(new PortraitStatesTouchController(launcher, allowDragToOverview));
        }
        if (FeatureFlags.PULL_DOWN_STATUS_BAR && Utilities.IS_DEBUG_DEVICE
+6 −10
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.view.View.VISIBLE;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.config.FeatureFlags.SWIPE_HOME;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
@@ -39,7 +38,8 @@ import com.android.launcher3.uioverrides.touchcontrollers.TaskViewTouchControlle
import com.android.launcher3.util.TouchController;
import com.android.launcher3.util.UiThreadHelper;
import com.android.launcher3.util.UiThreadHelper.AsyncCommand;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.system.WindowManagerWrapper;

@@ -58,15 +58,11 @@ public abstract class RecentsUiFactory {
    private static final float RECENTS_PREPARE_SCALE = 1.33f;

    public static TouchController[] createTouchControllers(Launcher launcher) {
        boolean swipeUpEnabled = OverviewInteractionState.INSTANCE.get(launcher)
                .isSwipeUpGestureEnabled();
        boolean swipeUpToHome = swipeUpEnabled && SWIPE_HOME.get();

        Mode mode = SysUINavigationMode.INSTANCE.get(launcher).getMode();

        ArrayList<TouchController> list = new ArrayList<>();
        list.add(launcher.getDragController());

        if (swipeUpToHome) {
        if (mode == Mode.NO_BUTTON) {
            list.add(new QuickSwitchTouchController(launcher));
            list.add(new FlingAndHoldTouchController(launcher));
        } else {
@@ -75,8 +71,8 @@ public abstract class RecentsUiFactory {
                list.add(new LandscapeEdgeSwipeController(launcher));
            } else {
                list.add(new PortraitStatesTouchController(launcher,
                        swipeUpEnabled /* allowDragToOverview */));
                if (swipeUpEnabled) {
                        mode.hasGestures /* allowDragToOverview */));
                if (mode.hasGestures) {
                    list.add(new QuickSwitchTouchController(launcher));
                }
            }
+2 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ import com.android.launcher3.util.FlingBlockCheck;
import com.android.launcher3.util.PendingAnimation;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;

@@ -123,8 +123,7 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>
                    if (mRecentsView.isTaskViewVisible(view) && mActivity.getDragLayer()
                            .isEventOverView(view, ev)) {
                        mTaskBeingDragged = view;
                        if (!OverviewInteractionState.INSTANCE.get(mActivity)
                                .isSwipeUpGestureEnabled()) {
                        if (!SysUINavigationMode.INSTANCE.get(mActivity).getMode().hasGestures) {
                            // Don't allow swipe down to open if we don't support swipe up
                            // to enter overview.
                            directionsToDetectScroll = SwipeDetector.DIRECTION_POSITIVE;
+3 −3
Original line number Diff line number Diff line
@@ -44,10 +44,10 @@ import android.view.MotionEvent;
import com.android.launcher3.MainThreadExecutor;
import com.android.launcher3.Utilities;
import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.EventLogArray;
import com.android.launcher3.util.LooperExecutor;
import com.android.launcher3.util.UiThreadHelper;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -315,8 +315,8 @@ public class TouchInteractionService extends Service {
                mOverviewComponentObserver.getActivityControlHelper();
        if (runningTaskInfo == null && !mSwipeSharedState.goingToLauncher) {
            return InputConsumer.NO_OP;
        } else if (mAssistantAvailable && mOverviewInteractionState.isSwipeUpGestureEnabled()
                && FeatureFlags.ENABLE_ASSISTANT_GESTURE.get()
        } else if (mAssistantAvailable
                && SysUINavigationMode.INSTANCE.get(this).getMode() == Mode.NO_BUTTON
                && AssistantTouchConsumer.withinTouchRegion(this, event)) {
            return new AssistantTouchConsumer(this, mISystemUiProxy, !activityControl.isResumed()
                            ? createOtherActivityInputConsumer(event, runningTaskInfo) : null);
Loading