Automated import from //branches/cupcake/...@142036,142036

This commit is contained in:
Jeffrey Sharkey 2009-03-24 18:52:29 -07:00 committed by The Android Open Source Project
parent 237eaa1e96
commit 392a6ba4fa
1 changed files with 14 additions and 14 deletions

View File

@ -1261,7 +1261,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
}
mBinder = new DesktopBinder(this, shortcuts, appWidgets, drawerAdapter);
mBinder.startWhenIdle();
mBinder.startBindingItems();
}
private void bindItems(Launcher.DesktopBinder binder,
@ -1364,7 +1364,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private void bindDrawer(Launcher.DesktopBinder binder,
ApplicationsAdapter drawerAdapter) {
mAllAppsGrid.setAdapter(drawerAdapter);
binder.startBindingAppWidgets();
binder.startBindingAppWidgetsWhenIdle();
}
private void bindAppWidgets(Launcher.DesktopBinder binder,
@ -2003,7 +2003,15 @@ public final class Launcher extends Activity implements View.OnClickListener, On
}
}
public void startWhenIdle() {
public void startBindingItems() {
obtainMessage(MESSAGE_BIND_ITEMS, 0, mShortcuts.size()).sendToTarget();
}
public void startBindingDrawer() {
obtainMessage(MESSAGE_BIND_DRAWER).sendToTarget();
}
public void startBindingAppWidgetsWhenIdle() {
// Ask for notification when message queue becomes idle
final MessageQueue messageQueue = Looper.myQueue();
messageQueue.addIdleHandler(this);
@ -2011,18 +2019,10 @@ public final class Launcher extends Activity implements View.OnClickListener, On
public boolean queueIdle() {
// Queue is idle, so start binding items
startBindingItems();
startBindingAppWidgets();
return false;
}
public void startBindingItems() {
obtainMessage(MESSAGE_BIND_ITEMS, 0, mShortcuts.size()).sendToTarget();
}
public void startBindingDrawer() {
obtainMessage(MESSAGE_BIND_DRAWER).sendToTarget();
}
public void startBindingAppWidgets() {
obtainMessage(MESSAGE_BIND_APPWIDGETS).sendToTarget();
}