diff options
author | Winson Chung <winsonc@google.com> | 2012-07-19 14:53:05 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2012-07-19 15:13:51 -0700 |
commit | 4a2afa36553079e9f75fe7c8fcce863e84578e14 (patch) | |
tree | a49c215243c1df9ec22cbe9c3d4381b8cfa34448 /src/com/android/launcher2/LauncherModel.java | |
parent | a6910c51097e3a4837ec8dbe26ab42094ff1cfec (diff) | |
download | android_packages_apps_Trebuchet-4a2afa36553079e9f75fe7c8fcce863e84578e14.tar.gz android_packages_apps_Trebuchet-4a2afa36553079e9f75fe7c8fcce863e84578e14.tar.bz2 android_packages_apps_Trebuchet-4a2afa36553079e9f75fe7c8fcce863e84578e14.zip |
Disabling synchronous binding when returning home from another app while orientation has changed. (Bug 6792288)
- Fixing issue where we were reverting to the first page of the workspace after launching an application from all apps, rotating, and returning home
- Enabling rotation in master.
Change-Id: I291b9d76b20244e9028b6f62164430bc3606644c
Diffstat (limited to 'src/com/android/launcher2/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 40ec7ca98..1b79c9b15 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -1653,7 +1653,8 @@ public class LauncherModel extends BroadcastReceiver { return; } - final int currentScreen = (synchronizeBindPage > -1) ? synchronizeBindPage : + final boolean isLoadingSynchronously = (synchronizeBindPage > -1); + final int currentScreen = isLoadingSynchronously ? synchronizeBindPage : oldCallbacks.getCurrentWorkspaceScreen(); // Load all the items that are on the current page first (and in the process, unbind @@ -1705,10 +1706,11 @@ public class LauncherModel extends BroadcastReceiver { bindWorkspaceItems(oldCallbacks, currentWorkspaceItems, currentAppWidgets, currentFolders, null); - // Load all the remaining pages + // Load all the remaining pages (if we are loading synchronously, we want to defer this + // work until after the first render) mDeferredBindRunnables.clear(); bindWorkspaceItems(oldCallbacks, otherWorkspaceItems, otherAppWidgets, otherFolders, - mDeferredBindRunnables); + (isLoadingSynchronously ? mDeferredBindRunnables : null)); // Tell the workspace that we're done binding items r = new Runnable() { @@ -1727,7 +1729,11 @@ public class LauncherModel extends BroadcastReceiver { mIsLoadingAndBindingWorkspace = false; } }; - mDeferredBindRunnables.add(r); + if (isLoadingSynchronously) { + mDeferredBindRunnables.add(r); + } else { + runOnMainThread(r); + } } private void loadAndBindAllApps() { |