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

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

Merge "Disabling seamless rotation in multiwindow mode" into ub-launcher3-qt-dev

parents 1c9b6293 da14cf8b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -490,9 +490,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
            mDeviceProfile = mDeviceProfile.getMultiWindowProfile(this, mwSize);
        }

        if (supportsFakeLandscapeUI()
                && mDeviceProfile.isVerticalBarLayout()
                && !mDeviceProfile.isMultiWindowMode) {
        if (supportsFakeLandscapeUI() && mDeviceProfile.isVerticalBarLayout()) {
            mStableDeviceProfile = mDeviceProfile.inv.portraitProfile;
            mRotationMode = UiFactory.getRotationMode(mDeviceProfile);
        } else {
@@ -500,6 +498,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
            mRotationMode = RotationMode.NORMAL;
        }

        mRotationHelper.updateRotationAnimation();
        onDeviceProfileInitiated();
        mModelWriter = mModel.getWriter(getWallpaperDeviceProfile().isVerticalBarLayout(), true);
    }
+8 −3
Original line number Diff line number Diff line
@@ -94,18 +94,22 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {

    public boolean homeScreenCanRotate() {
        return mIgnoreAutoRotateSettings || mAutoRotateEnabled
                || mStateHandlerRequest != REQUEST_NONE;
                || mStateHandlerRequest != REQUEST_NONE
                || mLauncher.getDeviceProfile().isMultiWindowMode;
    }

    private void updateRotationAnimation() {
    public void updateRotationAnimation() {
        if (FeatureFlags.FAKE_LANDSCAPE_UI.get()) {
            WindowManager.LayoutParams lp = mLauncher.getWindow().getAttributes();
            int oldAnim = lp.rotationAnimation;
            lp.rotationAnimation = homeScreenCanRotate()
                    ? WindowManager.LayoutParams.ROTATION_ANIMATION_ROTATE
                    : WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS;
            if (oldAnim != lp.rotationAnimation) {
                mLauncher.getWindow().setAttributes(lp);
            }
        }
    }

    @Override
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
@@ -123,6 +127,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener {
    public void setStateHandlerRequest(int request) {
        if (mStateHandlerRequest != request) {
            mStateHandlerRequest = request;
            updateRotationAnimation();
            notifyChange();
        }
    }