Merge "Fix "The specified child already has a parent" IllegalStateException." into ub-launcher3-burnaby-polish

This commit is contained in:
Tony Wickham
2015-10-15 18:00:59 +00:00
committed by Android (Google) Code Review
5 changed files with 59 additions and 28 deletions

View File

@@ -2061,6 +2061,7 @@ public class Workspace extends PagedView
@Override
public void onLauncherTransitionPrepare(Launcher l, boolean animated, boolean toWorkspace) {
mIsSwitchingState = true;
mTransitionProgress = 0;
// Invalidate here to ensure that the pages are rendered during the state change transition.
invalidate();
@@ -3660,11 +3661,6 @@ public class Workspace extends PagedView
Resources res = mLauncher.getResources();
final int duration = res.getInteger(R.integer.config_dropAnimMaxDuration) - 200;
// In the case where we've prebound the widget, we remove it from the DragLayer
if (finalView instanceof AppWidgetHostView && external) {
mLauncher.getDragLayer().removeView(finalView);
}
boolean isWidget = info.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET ||
info.itemType == LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET;
if ((animationType == ANIMATE_INTO_POSITION_AND_RESIZE || external) && finalView != null) {