summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AppsCustomizePagedView.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-07-23 20:48:26 -0700
committerAdam Cohen <adamcohen@google.com>2012-07-24 23:56:21 -0700
commitc93e5ae12018bb214099ff88a48cc21580aec4c3 (patch)
tree74057f57c16222358c9ca2beac683faa788c7019 /src/com/android/launcher2/AppsCustomizePagedView.java
parent1462de39f01cec0ba785386532719cb0207dd827 (diff)
downloadandroid_packages_apps_Trebuchet-c93e5ae12018bb214099ff88a48cc21580aec4c3.tar.gz
android_packages_apps_Trebuchet-c93e5ae12018bb214099ff88a48cc21580aec4c3.tar.bz2
android_packages_apps_Trebuchet-c93e5ae12018bb214099ff88a48cc21580aec4c3.zip
Binding AllApps synchronously. (Bug 6855061)
- Also ensuring that we restore to the settling page index if it is in motion Change-Id: I9c6760383113f7614f6cb962ab6562b0e7eb7138
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizePagedView.java')
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index a50836168..8cb169e17 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -528,18 +528,22 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
- public void onPackagesUpdated() {
- // TODO: this isn't ideal, but we actually need to delay here. This call is triggered
- // by a broadcast receiver, and in order for it to work correctly, we need to know that
- // the AppWidgetService has already received and processed the same broadcast. Since there
- // is no guarantee about ordering of broadcast receipt, we just delay here. This is a
- // workaround until we add a callback from AppWidgetService to AppWidgetHost when widget
- // packages are added, updated or removed.
- postDelayed(new Runnable() {
- public void run() {
- updatePackages();
- }
- }, 1500);
+ public void onPackagesUpdated(boolean immediate) {
+ if (immediate) {
+ updatePackages();
+ } else {
+ // TODO: this isn't ideal, but we actually need to delay here. This call is triggered
+ // by a broadcast receiver, and in order for it to work correctly, we need to know that
+ // the AppWidgetService has already received and processed the same broadcast. Since there
+ // is no guarantee about ordering of broadcast receipt, we just delay here. This is a
+ // workaround until we add a callback from AppWidgetService to AppWidgetHost when widget
+ // packages are added, updated or removed.
+ postDelayed(new Runnable() {
+ public void run() {
+ updatePackages();
+ }
+ }, 1500);
+ }
}
public void updatePackages() {
@@ -578,7 +582,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
@Override
public void onClick(View v) {
// When we have exited all apps or are in transition, disregard clicks
- if (!mLauncher.isAllAppsCustomizeOpen() ||
+ if (!mLauncher.isAllAppsVisible() ||
mLauncher.getWorkspace().isSwitchingState()) return;
if (v instanceof PagedViewIcon) {