diff options
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index ae2ca3b47..38085e029 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -371,7 +371,7 @@ public final class Launcher extends Activity // Update customization drawer _after_ restoring the states if (mAppsCustomizeContent != null) { - mAppsCustomizeContent.onPackagesUpdated(); + mAppsCustomizeContent.onPackagesUpdated(true); } if (PROFILE_STARTUP) { @@ -890,10 +890,8 @@ public final class Launcher extends Activity if (mAppsCustomizeTabHost != null) { String curTab = savedState.getString("apps_customize_currentTab"); if (curTab != null) { - // We set this directly so that there is no delay before the tab is set - mAppsCustomizeContent.setContentType( + mAppsCustomizeTabHost.setContentTypeImmediate( mAppsCustomizeTabHost.getContentTypeForTabTag(curTab)); - mAppsCustomizeTabHost.setCurrentTabByTag(curTab); mAppsCustomizeContent.loadAssociatedPages( mAppsCustomizeContent.getCurrentPage()); } @@ -1424,7 +1422,7 @@ public final class Launcher extends Activity @Override protected void onSaveInstanceState(Bundle outState) { - outState.putInt(RUNTIME_STATE_CURRENT_SCREEN, mWorkspace.getCurrentPage()); + outState.putInt(RUNTIME_STATE_CURRENT_SCREEN, mWorkspace.getNextPage()); super.onSaveInstanceState(outState); outState.putInt(RUNTIME_STATE, mState.ordinal()); @@ -1808,7 +1806,7 @@ public final class Launcher extends Activity @Override public void onBackPressed() { - if (mState == State.APPS_CUSTOMIZE) { + if (isAllAppsVisible()) { showWorkspace(true); } else if (mWorkspace.getOpenFolder() != null) { Folder openFolder = mWorkspace.getOpenFolder(); @@ -1881,7 +1879,7 @@ public final class Launcher extends Activity handleFolderClick(fi); } } else if (v == mAllAppsButton) { - if (mState == State.APPS_CUSTOMIZE) { + if (isAllAppsVisible()) { showWorkspace(true); } else { onClickAllAppsButton(v); @@ -2285,7 +2283,7 @@ public final class Launcher extends Activity // Now a part of LauncherModel.Callbacks. Used to reorder loading steps. public boolean isAllAppsVisible() { - return (mState == State.APPS_CUSTOMIZE); + return (mState == State.APPS_CUSTOMIZE) || (mOnResumeState == State.APPS_CUSTOMIZE); } public boolean isAllAppsButtonRank(int rank) { @@ -2312,7 +2310,7 @@ public final class Launcher extends Activity void disableWallpaperIfInAllApps() { // Only disable it if we are in all apps - if (mState == State.APPS_CUSTOMIZE) { + if (isAllAppsVisible()) { if (mAppsCustomizeTabHost != null && !mAppsCustomizeTabHost.isTransitioning()) { updateWallpaperVisibility(false); @@ -2753,7 +2751,7 @@ public final class Launcher extends Activity } void enterSpringLoadedDragMode() { - if (mState == State.APPS_CUSTOMIZE) { + if (isAllAppsVisible()) { hideAppsCustomizeHelper(State.APPS_CUSTOMIZE_SPRING_LOADED, true, true, null); hideDockDivider(); mState = State.APPS_CUSTOMIZE_SPRING_LOADED; @@ -2827,10 +2825,6 @@ public final class Launcher extends Activity // TODO } - public boolean isAllAppsCustomizeOpen() { - return mState == State.APPS_CUSTOMIZE; - } - /** * Shows the hotseat area. */ @@ -3460,23 +3454,30 @@ public final class Launcher extends Activity * Implementation of the method from LauncherModel.Callbacks. */ public void bindAllApplications(final ArrayList<ApplicationInfo> apps) { + Runnable setAllAppsRunnable = new Runnable() { + public void run() { + if (mAppsCustomizeContent != null) { + mAppsCustomizeContent.setApps(apps); + } + } + }; + // Remove the progress bar entirely; we could also make it GONE // but better to remove it since we know it's not going to be used View progressBar = mAppsCustomizeTabHost. findViewById(R.id.apps_customize_progress_bar); if (progressBar != null) { ((ViewGroup)progressBar.getParent()).removeView(progressBar); + + // We just post the call to setApps so the user sees the progress bar + // disappear-- otherwise, it just looks like the progress bar froze + // which doesn't look great + mAppsCustomizeTabHost.post(setAllAppsRunnable); + } else { + // If we did not initialize the spinner in onCreate, then we can directly set the + // list of applications without waiting for any progress bars views to be hidden. + setAllAppsRunnable.run(); } - // We just post the call to setApps so the user sees the progress bar - // disappear-- otherwise, it just looks like the progress bar froze - // which doesn't look great - mAppsCustomizeTabHost.post(new Runnable() { - public void run() { - if (mAppsCustomizeContent != null) { - mAppsCustomizeContent.setApps(apps); - } - } - }); } /** @@ -3531,7 +3532,7 @@ public final class Launcher extends Activity */ public void bindPackagesUpdated() { if (mAppsCustomizeContent != null) { - mAppsCustomizeContent.onPackagesUpdated(); + mAppsCustomizeContent.onPackagesUpdated(false); } } |