Loading src/com/android/launcher3/Workspace.java +27 −13 Original line number Diff line number Diff line Loading @@ -2063,20 +2063,11 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> if (container != LauncherSettings.Favorites.CONTAINER_HOTSEAT && cell instanceof LauncherAppWidgetHostView) { final CellLayout cellLayout = dropTargetLayout; // We post this call so that the widget has a chance to be placed // in its final location final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell; AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo(); if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE && !options.isAccessibleDrag) { onCompleteRunnable = () -> { if (!isPageInTransition()) { AppWidgetResizeFrame.showForWidget(hostView, cellLayout); } }; } onCompleteRunnable = getWidgetResizeFrameRunnable(options, (LauncherAppWidgetHostView) cell, dropTargetLayout); } mLauncher.getModelWriter().modifyItemInDatabase(info, container, screenId, lp.cellX, lp.cellY, item.spanX, item.spanY); Loading @@ -2097,8 +2088,16 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> } } else { // When drag is cancelled, reattach content view back to its original parent. if (mDragInfo.cell instanceof LauncherAppWidgetHostView) { if (cell instanceof LauncherAppWidgetHostView) { d.dragView.detachContentView(/* reattachToPreviousParent= */ true); final CellLayout cellLayout = getParentCellLayoutForView(cell); boolean pageIsVisible = isVisible(cellLayout); if (pageIsVisible) { onCompleteRunnable = getWidgetResizeFrameRunnable(options, (LauncherAppWidgetHostView) cell, cellLayout); } } } Loading Loading @@ -2151,6 +2150,21 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> } } @Nullable private Runnable getWidgetResizeFrameRunnable(DragOptions options, LauncherAppWidgetHostView hostView, CellLayout cellLayout) { AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo(); if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE && !options.isAccessibleDrag) { return () -> { if (!isPageInTransition()) { AppWidgetResizeFrame.showForWidget(hostView, cellLayout); } }; } return null; } public void onNoCellFound( View dropTargetLayout, ItemInfo itemInfo, @Nullable InstanceId logInstanceId) { int strId = mLauncher.isHotseatLayout(dropTargetLayout) Loading Loading
src/com/android/launcher3/Workspace.java +27 −13 Original line number Diff line number Diff line Loading @@ -2063,20 +2063,11 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> if (container != LauncherSettings.Favorites.CONTAINER_HOTSEAT && cell instanceof LauncherAppWidgetHostView) { final CellLayout cellLayout = dropTargetLayout; // We post this call so that the widget has a chance to be placed // in its final location final LauncherAppWidgetHostView hostView = (LauncherAppWidgetHostView) cell; AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo(); if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE && !options.isAccessibleDrag) { onCompleteRunnable = () -> { if (!isPageInTransition()) { AppWidgetResizeFrame.showForWidget(hostView, cellLayout); } }; } onCompleteRunnable = getWidgetResizeFrameRunnable(options, (LauncherAppWidgetHostView) cell, dropTargetLayout); } mLauncher.getModelWriter().modifyItemInDatabase(info, container, screenId, lp.cellX, lp.cellY, item.spanX, item.spanY); Loading @@ -2097,8 +2088,16 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> } } else { // When drag is cancelled, reattach content view back to its original parent. if (mDragInfo.cell instanceof LauncherAppWidgetHostView) { if (cell instanceof LauncherAppWidgetHostView) { d.dragView.detachContentView(/* reattachToPreviousParent= */ true); final CellLayout cellLayout = getParentCellLayoutForView(cell); boolean pageIsVisible = isVisible(cellLayout); if (pageIsVisible) { onCompleteRunnable = getWidgetResizeFrameRunnable(options, (LauncherAppWidgetHostView) cell, cellLayout); } } } Loading Loading @@ -2151,6 +2150,21 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> } } @Nullable private Runnable getWidgetResizeFrameRunnable(DragOptions options, LauncherAppWidgetHostView hostView, CellLayout cellLayout) { AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo(); if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE && !options.isAccessibleDrag) { return () -> { if (!isPageInTransition()) { AppWidgetResizeFrame.showForWidget(hostView, cellLayout); } }; } return null; } public void onNoCellFound( View dropTargetLayout, ItemInfo itemInfo, @Nullable InstanceId logInstanceId) { int strId = mLauncher.isHotseatLayout(dropTargetLayout) Loading