Correct color extraction on App Widget drop.
Disable color extraction on drop until the workspace is back to its normal size, then re-enable it and force re-coloring. This needs to happen if the drop is on the workspace, but also if the drop is on the secondary target. Fix: 192354264 Test: Manual, see bug for details. Change-Id: If573641e4bb5a98ed6b5008e00f70f4bbe492c24
This commit is contained in:
@@ -1833,8 +1833,11 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
onDropExternal(touchXY, dropTargetLayout, d);
|
||||
} else {
|
||||
final View cell = mDragInfo.cell;
|
||||
final DragView dragView = d.dragView;
|
||||
boolean droppedOnOriginalCellDuringTransition = false;
|
||||
Runnable onCompleteRunnable = null;
|
||||
Runnable onCompleteRunnable = dragView::resumeColorExtraction;
|
||||
|
||||
dragView.disableColorExtraction();
|
||||
|
||||
if (dropTargetLayout != null && !d.cancelled) {
|
||||
// Move internally
|
||||
@@ -1945,7 +1948,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
|
||||
if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
|
||||
&& !options.isAccessibleDrag) {
|
||||
final Runnable previousRunnable = onCompleteRunnable;
|
||||
onCompleteRunnable = () -> {
|
||||
previousRunnable.run();
|
||||
if (!isPageInTransition()) {
|
||||
AppWidgetResizeFrame.showForWidget(hostView, cellLayout);
|
||||
}
|
||||
@@ -2014,7 +2019,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
parent.onDropChild(cell);
|
||||
|
||||
mLauncher.getStateManager().goToState(NORMAL, SPRING_LOADED_EXIT_DELAY,
|
||||
onCompleteRunnable == null ? null : forSuccessCallback(onCompleteRunnable));
|
||||
forSuccessCallback(onCompleteRunnable));
|
||||
mStatsLogManager.logger().withItemInfo(d.dragInfo).withInstanceId(d.logInstanceId)
|
||||
.log(LauncherEvent.LAUNCHER_ITEM_DROP_COMPLETED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user