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

Commit 9e84e0c1 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Removing SWIPE_HOME flag and using sysUI mode instead

Bug: 129873705
Change-Id: Ieaa7d7928427daed98538c616bdf58b28d295829
parent 5fadfe56
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public abstract class RecentsUiFactory {
    private static final float RECENTS_PREPARE_SCALE = 1.33f;

    public static TouchController[] createTouchControllers(Launcher launcher) {
        Mode mode = SysUINavigationMode.INSTANCE.get(launcher).getMode();
        Mode mode = SysUINavigationMode.getMode(launcher);

        ArrayList<TouchController> list = new ArrayList<>();
        list.add(launcher.getDragController());
@@ -106,7 +106,7 @@ public abstract class RecentsUiFactory {
     * @param launcher the launcher activity
     */
    public static void prepareToShowOverview(Launcher launcher) {
        if (FeatureFlags.SWIPE_HOME.get()) {
        if (SysUINavigationMode.getMode(launcher) == Mode.NO_BUTTON) {
            // Overview lives on the side, so doesn't scale in from above.
            return;
        }
+3 −2
Original line number Diff line number Diff line
@@ -20,8 +20,9 @@ import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS;
import android.os.RemoteException;
import com.android.launcher3.Launcher;
import com.android.launcher3.allapps.AllAppsTransitionController;
import com.android.launcher3.config.FeatureFlags;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.util.LayoutUtils;
import com.android.quickstep.views.RecentsView;
import com.android.systemui.shared.recents.ISystemUiProxy;
@@ -76,7 +77,7 @@ public class BackgroundAppState extends OverviewState {

    @Override
    public int getVisibleElements(Launcher launcher) {
        if (FeatureFlags.SWIPE_HOME.get()) {
        if (SysUINavigationMode.getMode(launcher) == Mode.NO_BUTTON) {
            return super.getVisibleElements(launcher);
        }
        // Hide shelf content (e.g. QSB) because we fade it in when swiping up.
+3 −2
Original line number Diff line number Diff line
@@ -36,11 +36,12 @@ import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.quickstep.SysUINavigationMode;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;

@@ -105,7 +106,7 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll
    private void setupInterpolators(AnimatorSetBuilder animatorSetBuilder) {
        animatorSetBuilder.setInterpolator(ANIM_WORKSPACE_FADE, DEACCEL_2);
        animatorSetBuilder.setInterpolator(ANIM_ALL_APPS_FADE, DEACCEL_2);
        if (FeatureFlags.SWIPE_HOME.get()) {
        if (SysUINavigationMode.getMode(mLauncher) == Mode.NO_BUTTON) {
            // Overview lives to the left of workspace, so translate down later than over
            animatorSetBuilder.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCEL_2);
            animatorSetBuilder.setInterpolator(ANIM_VERTICAL_PROGRESS, ACCEL_2);
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>
                    if (mRecentsView.isTaskViewVisible(view) && mActivity.getDragLayer()
                            .isEventOverView(view, ev)) {
                        mTaskBeingDragged = view;
                        if (!SysUINavigationMode.INSTANCE.get(mActivity).getMode().hasGestures) {
                        if (!SysUINavigationMode.getMode(mActivity).hasGestures) {
                            // Don't allow swipe down to open if we don't support swipe up
                            // to enter overview.
                            directionsToDetectScroll = SwipeDetector.DIRECTION_POSITIVE;
+5 −7
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.quickstep;

import static android.view.View.TRANSLATION_Y;

import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.LauncherState.NORMAL;
@@ -24,7 +25,6 @@ import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_D
import static com.android.launcher3.allapps.AllAppsTransitionController.SPRING_STIFFNESS;
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.quickstep.SysUINavigationMode.Mode.NO_BUTTON;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -45,16 +45,15 @@ import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherInitListener;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager;
import com.android.launcher3.Workspace;
import com.android.launcher3.allapps.AllAppsTransitionController;
import com.android.launcher3.allapps.DiscoveryBounce;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.SpringObjectAnimator;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.views.FloatingIconView;
import com.android.quickstep.SysUINavigationMode.Mode;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.LayoutUtils;
import com.android.quickstep.views.RecentsView;
@@ -76,8 +75,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
    @Override
    public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect) {
        LayoutUtils.calculateLauncherTaskSize(context, dp, outRect);
        if (dp.isVerticalBarLayout()
                && SysUINavigationMode.INSTANCE.get(context).getMode() != NO_BUTTON) {
        if (dp.isVerticalBarLayout() && SysUINavigationMode.getMode(context) != Mode.NO_BUTTON) {
            Rect targetInsets = dp.getInsets();
            int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right;
            return dp.hotseatBarSizePx + hotseatInset;
@@ -254,8 +252,8 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe

        AnimatorSet anim = new AnimatorSet();
        if (!activity.getDeviceProfile().isVerticalBarLayout()
                && !FeatureFlags.SWIPE_HOME.get()) {
            // Don't animate the shelf when SWIPE_HOME is true, because we update it atomically.
                && SysUINavigationMode.getMode(activity) != Mode.NO_BUTTON) {
            // Don't animate the shelf when the mode is NO_BUTTON, because we update it atomically.
            Animator shiftAnim = createShelfProgressAnim(activity,
                    fromState.getVerticalProgress(activity),
                    endState.getVerticalProgress(activity));
Loading