diff options
author | Michael Jurka <mikejurka@google.com> | 2011-08-09 22:02:20 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-08-09 22:36:01 -0700 |
commit | c57b7a8233d32c6dd8de5057c570afe3f50e3ef2 (patch) | |
tree | c6545d4d2f2f8adb888cc6abf99a5742a6aa94af /src/com/android/launcher2/Launcher.java | |
parent | 146eef2808de1ab5767e0a089a0e859010107f34 (diff) | |
download | packages_apps_trebuchet-c57b7a8233d32c6dd8de5057c570afe3f50e3ef2.zip packages_apps_trebuchet-c57b7a8233d32c6dd8de5057c570afe3f50e3ef2.tar.gz packages_apps_trebuchet-c57b7a8233d32c6dd8de5057c570afe3f50e3ef2.tar.bz2 |
Adding a progress bar while All Apps is loading
- also, removing some unused imports
Change-Id: Icf46beb9fa9d89bc06cba33c148ceb7d668cd402
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index f8e3e1c..b1f56d0 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -291,6 +291,11 @@ public final class Launcher extends Activity mModel.startLoader(this, true); } + if (!mModel.isAllAppsLoaded()) { + ViewGroup appsCustomizeContentParent = (ViewGroup) mAppsCustomizeContent.getParent(); + mInflater.inflate(R.layout.apps_customize_progressbar, appsCustomizeContentParent); + } + // For handling default keys mDefaultKeySsb = new SpannableStringBuilder(); Selection.setSelection(mDefaultKeySsb, 0); @@ -2771,10 +2776,25 @@ public final class Launcher extends Activity * * Implementation of the method from LauncherModel.Callbacks. */ - public void bindAllApplications(ArrayList<ApplicationInfo> apps) { - if (mAppsCustomizeContent != null) { - mAppsCustomizeContent.setApps(apps); - } + public void bindAllApplications(final ArrayList<ApplicationInfo> 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(new Runnable() { + public void run() { + if (mAppsCustomizeContent != null) { + mAppsCustomizeContent.setApps(apps); + } + } + }); + updateIconsAffectedByPackageManagerChanges(); updateGlobalSearchIcon(); } |