From a999e22560d477edfe98e83c62e3af4b9fbe8461 Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Mon, 19 Apr 2021 18:17:15 +0100 Subject: [PATCH] Apply color extraction when dragging Bug: 185795141 Test: Drag the test color extraction widget and observe the change in the widget background. Change-Id: I17203fcb0d7579b1570c68f22248966c3a561c64 --- src/com/android/launcher3/CellLayout.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index fc09295d7b..bb83802d2a 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -1038,6 +1038,9 @@ public class CellLayout extends ViewGroup { mDragCellSpan[0] = spanX; mDragCellSpan[1] = spanY; + // Apply color extraction on a widget when dragging. + applyColorExtractionOnWidget(dragObject, mDragCell, spanX, spanY); + final int oldIndex = mDragOutlineCurrent; mDragOutlineAnims[oldIndex].animateOut(); mDragOutlineCurrent = (oldIndex + 1) % mDragOutlines.length; @@ -1059,8 +1062,8 @@ public class CellLayout extends ViewGroup { } /** Applies the local color extraction to a dragging widget object. */ - private void applyColorExtraction(DropTarget.DragObject dragObject, int[] targetCell, int spanX, - int spanY) { + private void applyColorExtractionOnWidget(DropTarget.DragObject dragObject, int[] targetCell, + int spanX, int spanY) { // Apply local extracted color if the DragView is an AppWidgetHostViewDrawable. Drawable drawable = dragObject.dragView.getDrawable(); if (drawable instanceof AppWidgetHostViewDrawable) {