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

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

Merge "Disable seamless rotation for 3 and 2 button mode" into ub-launcher3-qt-dev

parents 8278148e 0b1cb75e
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import com.android.launcher3.LauncherStateManager;
import com.android.launcher3.LauncherStateManager.StateHandler;
import com.android.launcher3.QuickstepAppTransitionManagerImpl;
import com.android.launcher3.Utilities;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.proxy.ProxyActivityStarter;
import com.android.launcher3.proxy.StartActivityParams;
import com.android.quickstep.OverviewInteractionState;
@@ -64,10 +63,14 @@ import java.util.zip.Deflater;

public class UiFactory extends RecentsUiFactory {

    public static Runnable enableLiveTouchControllerChanges(DragLayer dl) {
        NavigationModeChangeListener listener = m -> dl.recreateControllers();
        SysUINavigationMode mode = SysUINavigationMode.INSTANCE.get(dl.getContext());
        mode.addModeChangeListener(listener);
    public static Runnable enableLiveUIChanges(Launcher launcher) {
        NavigationModeChangeListener listener = m -> {
            launcher.getDragLayer().recreateControllers();
            launcher.getRotationHelper().setRotationHadDifferentUI(m != Mode.NO_BUTTON);
        };
        SysUINavigationMode mode = SysUINavigationMode.INSTANCE.get(launcher);
        SysUINavigationMode.Mode m = mode.addModeChangeListener(listener);
        launcher.getRotationHelper().setRotationHadDifferentUI(m != Mode.NO_BUTTON);
        return () -> mode.removeModeChangeListener(listener);
    }

+1 −1
Original line number Diff line number Diff line
@@ -1063,7 +1063,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,

        // Setup the drag layer
        mDragLayer.setup(mDragController, mWorkspace);
        mCancelTouchController = UiFactory.enableLiveTouchControllerChanges(mDragLayer);
        mCancelTouchController = UiFactory.enableLiveUIChanges(this);

        mWorkspace.setup(mDragController);
        // Until the workspace is bound, ensure that we keep the wallpaper offset locked to the
+7 −2
Original line number Diff line number Diff line
@@ -73,7 +73,8 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {

    // This is used to defer setting rotation flags until the activity is being created
    private boolean mInitialized;
    public boolean mDestroyed;
    private boolean mDestroyed;
    private boolean mRotationHasDifferentUI;

    private int mLastActivityFlags = -1;

@@ -92,8 +93,12 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
        }
    }

    public void setRotationHadDifferentUI(boolean rotationHasDifferentUI) {
        mRotationHasDifferentUI = rotationHasDifferentUI;
    }

    public boolean homeScreenCanRotate() {
        return mIgnoreAutoRotateSettings || mAutoRotateEnabled
        return mRotationHasDifferentUI || mIgnoreAutoRotateSettings || mAutoRotateEnabled
                || mStateHandlerRequest != REQUEST_NONE
                || mLauncher.getDeviceProfile().isMultiWindowMode;
    }
+1 −2
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState.ScaleAndTranslation;
import com.android.launcher3.LauncherStateManager.StateHandler;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.graphics.RotationMode;
import com.android.launcher3.util.TouchController;

@@ -40,7 +39,7 @@ public class UiFactory {
                launcher.getDragController(), new AllAppsSwipeController(launcher)};
    }

    public static Runnable enableLiveTouchControllerChanges(DragLayer dl) {
    public static Runnable enableLiveUIChanges(Launcher l) {
        return null;
    }