diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-05-30 17:47:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-05-30 17:47:51 +0000 |
commit | cae0a80c83992fd874473373f7324f13725b24ae (patch) | |
tree | 5ff12766ea64a84138ac0646f36a55a2542f7557 /src | |
parent | 1c9b6293c8c523b0e9fccde6761ebf6b27995320 (diff) | |
parent | da14cf8b9febb39b42545d4fe3c3cbda0b9cc156 (diff) | |
download | android_packages_apps_Trebuchet-cae0a80c83992fd874473373f7324f13725b24ae.tar.gz android_packages_apps_Trebuchet-cae0a80c83992fd874473373f7324f13725b24ae.tar.bz2 android_packages_apps_Trebuchet-cae0a80c83992fd874473373f7324f13725b24ae.zip |
Merge "Disabling seamless rotation in multiwindow mode" into ub-launcher3-qt-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 5 | ||||
-rw-r--r-- | src/com/android/launcher3/states/RotationHelper.java | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 711cfd288..ed0b90fcc 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -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); } diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java index b6c3c35b8..cd96d6ed8 100644 --- a/src/com/android/launcher3/states/RotationHelper.java +++ b/src/com/android/launcher3/states/RotationHelper.java @@ -94,16 +94,20 @@ 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; - mLauncher.getWindow().setAttributes(lp); + if (oldAnim != lp.rotationAnimation) { + mLauncher.getWindow().setAttributes(lp); + } } } @@ -123,6 +127,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { public void setStateHandlerRequest(int request) { if (mStateHandlerRequest != request) { mStateHandlerRequest = request; + updateRotationAnimation(); notifyChange(); } } |