Merge "Initial changes to synchronously load workspace on rotation."

This commit is contained in:
Winson Chung
2012-07-18 10:27:56 -07:00
committed by Android (Google) Code Review
4 changed files with 720 additions and 481 deletions
+7 -2
View File
@@ -354,6 +354,11 @@ public final class Launcher extends Activity
mAppWidgetHost = new LauncherAppWidgetHost(this, APPWIDGET_HOST_ID);
mAppWidgetHost.startListening();
// If we are getting an onCreate, we can actually preempt onResume and unset mPaused here,
// this also ensures that any synchronous binding below doesn't re-trigger another
// LauncherModel load.
mPaused = false;
if (PROFILE_STARTUP) {
android.os.Debug.startMethodTracing(
Environment.getExternalStorageDirectory() + "/launcher");
@@ -381,7 +386,7 @@ public final class Launcher extends Activity
}
if (!mRestoring) {
mModel.startLoader(true);
mModel.startLoader(true, mWorkspace.getCurrentPage());
}
if (!mModel.isAllAppsLoaded()) {
@@ -693,7 +698,7 @@ public final class Launcher extends Activity
mPaused = false;
if (mRestoring || mOnResumeNeedsLoad) {
mWorkspaceLoading = true;
mModel.startLoader(true);
mModel.startLoader(true, -1);
mRestoring = false;
mOnResumeNeedsLoad = false;
}
@@ -52,6 +52,8 @@ public class LauncherAnimUtils {
for (Animator a : animators) {
if (a.isRunning()) {
a.cancel();
} else {
sAnimators.remove(a);
}
}
}
File diff suppressed because it is too large Load Diff
+8
View File
@@ -1283,6 +1283,14 @@ public class Workspace extends SmoothPagedView
}
super.onDraw(canvas);
// Call back to LauncherModel to finish binding after the first draw
post(new Runnable() {
@Override
public void run() {
mLauncher.getModel().bindRemainingSynchronousPages();
}
});
}
boolean isDrawingBackgroundGradient() {