diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-05-22 15:17:52 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-22 15:21:56 -0700 |
commit | be8c34077cb06da736053926f931c3e4f0be44dc (patch) | |
tree | e6139e9093db238623bdc9642cb7aa226338efa9 /src/com/android/launcher3/states | |
parent | 07b985b5e5763bafec786d52b8f65fdcff2d1b14 (diff) | |
download | android_packages_apps_Trebuchet-be8c34077cb06da736053926f931c3e4f0be44dc.tar.gz android_packages_apps_Trebuchet-be8c34077cb06da736053926f931c3e4f0be44dc.tar.bz2 android_packages_apps_Trebuchet-be8c34077cb06da736053926f931c3e4f0be44dc.zip |
Lock launcher rotation during activity transition to allow
proper seamless transition at the end
Bug: 131360075
Change-Id: I2b76d4b3e0528e56b7b4709fd3708bc858bf1612
Diffstat (limited to 'src/com/android/launcher3/states')
-rw-r--r-- | src/com/android/launcher3/states/RotationHelper.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java index 3727fa663..b6c3c35b8 100644 --- a/src/com/android/launcher3/states/RotationHelper.java +++ b/src/com/android/launcher3/states/RotationHelper.java @@ -63,6 +63,10 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { */ private int mStateHandlerRequest = REQUEST_NONE; /** + * Rotation request made by an app transition + */ + private int mCurrentTransitionRequest = REQUEST_NONE; + /** * Rotation request made by a Launcher State */ private int mCurrentStateRequest = REQUEST_NONE; @@ -123,6 +127,13 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { } } + public void setCurrentTransitionRequest(int request) { + if (mCurrentTransitionRequest != request) { + mCurrentTransitionRequest = request; + notifyChange(); + } + } + public void setCurrentStateRequest(int request) { if (mCurrentStateRequest != request) { mCurrentStateRequest = request; @@ -163,6 +174,9 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { if (mStateHandlerRequest != REQUEST_NONE) { activityFlags = mStateHandlerRequest == REQUEST_LOCK ? SCREEN_ORIENTATION_LOCKED : SCREEN_ORIENTATION_UNSPECIFIED; + } else if (mCurrentTransitionRequest != REQUEST_NONE) { + activityFlags = mCurrentTransitionRequest == REQUEST_LOCK ? + SCREEN_ORIENTATION_LOCKED : SCREEN_ORIENTATION_UNSPECIFIED; } else if (mCurrentStateRequest == REQUEST_LOCK) { activityFlags = SCREEN_ORIENTATION_LOCKED; } else if (mIgnoreAutoRotateSettings || mCurrentStateRequest == REQUEST_ROTATE |