diff options
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 1e12b423f..522e96a12 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -251,6 +251,10 @@ public class Launcher extends BaseActivity // Main container view and the model for the widget tray screen. @Thunk WidgetsContainerView mWidgetsView; + // We need to store the orientation Launcher was created with, due to a bug (b/64916689) + // that results in widgets being inflated in the wrong orientation. + private int mOrientation; + // We set the state in both onCreate and then onNewIntent in some cases, which causes both // scroll issues (because the workspace may not have been measured yet) and extra work. // Instead, just save the state that we need to restore Launcher to, and commit it in onResume. @@ -383,6 +387,7 @@ public class Launcher extends BaseActivity mDeviceProfile = mDeviceProfile.getMultiWindowProfile(this, mwSize); } + mOrientation = getResources().getConfiguration().orientation; mSharedPrefs = Utilities.getPrefs(this); mIsSafeModeEnabled = getPackageManager().isSafeMode(); mModel = app.setLauncher(this); @@ -1669,6 +1674,8 @@ public class Launcher extends BaseActivity return mSharedPrefs; } + public int getOrientation() { return mOrientation; } + @Override protected void onNewIntent(Intent intent) { long startTime = 0; |