diff options
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index bbee7879f..659077f71 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -690,33 +690,13 @@ public final class Launcher extends Activity // Consequently, the widgets will be inflated in the orientation of the foreground activity // (framework issue). On resuming, we ensure that any widgets are inflated for the current // orientation. - reinflateWidgetsIfNecessary(); + getWorkspace().reinflateWidgetsIfNecessary(); // Again, as with the above scenario, it's possible that one or more of the global icons // were updated in the wrong orientation. updateGlobalIcons(); } - void reinflateWidgetsIfNecessary() { - for (LauncherAppWidgetInfo info: LauncherModel.getWidgets()) { - LauncherAppWidgetHostView lahv = (LauncherAppWidgetHostView) info.hostView; - if (lahv != null && lahv.orientationChangedSincedInflation()) { - AppWidgetProviderInfo pInfo = lahv.getAppWidgetInfo(); - - // Remove the current widget which is inflated with the wrong orientation - getWorkspace().getParentCellLayoutForView(lahv).removeView(lahv); - // Re-inflate the widget using the correct orientation - AppWidgetHostView widget = mAppWidgetHost.createView(this, info.appWidgetId, pInfo); - - // Add the new widget back - widget.setTag(info); - info.hostView = widget; - getWorkspace().addInScreen(widget, info.container, info.screen, - info.cellX, info.cellY, info.spanX, info.spanY); - } - } - } - @Override protected void onPause() { // NOTE: We want all transitions from launcher to act as if the wallpaper were enabled @@ -3226,7 +3206,6 @@ public final class Launcher extends Activity item.hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo); - item.hostView.setAppWidget(appWidgetId, appWidgetInfo); item.hostView.setTag(item); item.onBindAppWidget(this); |