Merge "Disable seamless rotation for 3 and 2 button mode" into ub-launcher3-qt-dev
am: 19f7c6fefb
Change-Id: Iec2636f14a157e9a9b5e9c47e1c258b9158dc942
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user