Automated import from //branches/donutburger/...@140670,140670

This commit is contained in:
Jeffrey Sharkey 2009-03-24 18:11:49 -07:00 committed by The Android Open Source Project
parent 9b141a29ba
commit d18299f1d8
1 changed files with 18 additions and 16 deletions

View File

@ -1350,25 +1350,27 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private void bindAppWidgets(Launcher.DesktopBinder binder, private void bindAppWidgets(Launcher.DesktopBinder binder,
LinkedList<LauncherAppWidgetInfo> appWidgets) { LinkedList<LauncherAppWidgetInfo> appWidgets) {
final Workspace workspace = mWorkspace; final Workspace workspace = mWorkspace;
final boolean desktopLocked = mDesktopLocked; final boolean desktopLocked = mDesktopLocked;
final LauncherAppWidgetInfo item = appWidgets.removeFirst(); if (!appWidgets.isEmpty()) {
final LauncherAppWidgetInfo item = appWidgets.removeFirst();
final int appWidgetId = item.appWidgetId;
final AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId); final int appWidgetId = item.appWidgetId;
item.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo); final AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
item.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
if (LOGD) d(LOG_TAG, String.format("about to setAppWidget for id=%d, info=%s", appWidgetId, appWidgetInfo));
if (LOGD) d(LOG_TAG, String.format("about to setAppWidget for id=%d, info=%s", appWidgetId, appWidgetInfo));
item.hostView.setAppWidget(appWidgetId, appWidgetInfo);
item.hostView.setTag(item); item.hostView.setAppWidget(appWidgetId, appWidgetInfo);
item.hostView.setTag(item);
workspace.addInScreen(item.hostView, item.screen, item.cellX,
item.cellY, item.spanX, item.spanY, !desktopLocked); workspace.addInScreen(item.hostView, item.screen, item.cellX,
item.cellY, item.spanX, item.spanY, !desktopLocked);
workspace.requestLayout();
workspace.requestLayout();
}
if (appWidgets.isEmpty()) { if (appWidgets.isEmpty()) {
if (PROFILE_ROTATE) { if (PROFILE_ROTATE) {