summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherModel.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-03-30 17:31:24 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-03-30 18:24:07 -0700
commit93f878c1686f0438f399353b6fa61ac256f89e6d (patch)
tree066f88d30adac615be91bc58df315e049a1b8f9b /src/com/android/launcher3/LauncherModel.java
parent7efe651226f999ca32506fd2756ae18935320182 (diff)
downloadandroid_packages_apps_Trebuchet-93f878c1686f0438f399353b6fa61ac256f89e6d.tar.gz
android_packages_apps_Trebuchet-93f878c1686f0438f399353b6fa61ac256f89e6d.tar.bz2
android_packages_apps_Trebuchet-93f878c1686f0438f399353b6fa61ac256f89e6d.zip
Fixing the loader to bind the first screen as well as the hotseat together
When the loader ran for the first time (or when called due to force-reload), it was binding with page = -1 (invalid pageId is -1001). This was causing loader to assume the workspace to be on a valid screen, and causing the loader to only bind the hotseat first. Bug: 27705838 Change-Id: Ia8eb2543d8cee1268256b2d6bccf33828937c54a
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r--src/com/android/launcher3/LauncherModel.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 3c7366cc3..9208d329e 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -1266,17 +1266,13 @@ public class LauncherModel extends BroadcastReceiver
* of doing it now.
*/
public void startLoaderFromBackground() {
- boolean runLoader = false;
Callbacks callbacks = getCallback();
if (callbacks != null) {
// Only actually run the loader if they're not paused.
if (!callbacks.setLoadOnResume()) {
- runLoader = true;
+ startLoader(callbacks.getCurrentWorkspaceScreen());
}
}
- if (runLoader) {
- startLoader(PagedView.INVALID_RESTORE_PAGE);
- }
}
/**
@@ -1313,7 +1309,7 @@ public class LauncherModel extends BroadcastReceiver
// If there is already one running, tell it to stop.
stopLoaderLocked();
- mLoaderTask = new LoaderTask(mApp.getContext(), loadFlags);
+ mLoaderTask = new LoaderTask(mApp.getContext(), loadFlags, synchronousBindPage);
if (synchronousBindPage != PagedView.INVALID_RESTORE_PAGE
&& mAllAppsLoaded && mWorkspaceLoaded && !mIsLoaderTaskRunning) {
mLoaderTask.runBindSynchronousPage(synchronousBindPage);
@@ -1367,14 +1363,17 @@ public class LauncherModel extends BroadcastReceiver
*/
private class LoaderTask implements Runnable {
private Context mContext;
+ private int mPageToBindFirst;
+
@Thunk boolean mIsLoadingAndBindingWorkspace;
private boolean mStopped;
@Thunk boolean mLoadAndBindStepFinished;
private int mFlags;
- LoaderTask(Context context, int flags) {
+ LoaderTask(Context context, int flags, int pageToBindFirst) {
mContext = context;
mFlags = flags;
+ mPageToBindFirst = pageToBindFirst;
}
private void loadAndBindWorkspace() {
@@ -1396,7 +1395,7 @@ public class LauncherModel extends BroadcastReceiver
}
// Bind the workspace
- bindWorkspace(-1);
+ bindWorkspace(mPageToBindFirst);
}
private void waitForIdle() {