Merge "Apply color extraction when dragging" into sc-dev am: 315bef15e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14234626 Change-Id: I93d2047e8e3618218e420077649dbbdcc3e4d8d2
This commit is contained in:
@@ -1038,6 +1038,9 @@ public class CellLayout extends ViewGroup {
|
|||||||
mDragCellSpan[0] = spanX;
|
mDragCellSpan[0] = spanX;
|
||||||
mDragCellSpan[1] = spanY;
|
mDragCellSpan[1] = spanY;
|
||||||
|
|
||||||
|
// Apply color extraction on a widget when dragging.
|
||||||
|
applyColorExtractionOnWidget(dragObject, mDragCell, spanX, spanY);
|
||||||
|
|
||||||
final int oldIndex = mDragOutlineCurrent;
|
final int oldIndex = mDragOutlineCurrent;
|
||||||
mDragOutlineAnims[oldIndex].animateOut();
|
mDragOutlineAnims[oldIndex].animateOut();
|
||||||
mDragOutlineCurrent = (oldIndex + 1) % mDragOutlines.length;
|
mDragOutlineCurrent = (oldIndex + 1) % mDragOutlines.length;
|
||||||
@@ -1059,8 +1062,8 @@ public class CellLayout extends ViewGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Applies the local color extraction to a dragging widget object. */
|
/** Applies the local color extraction to a dragging widget object. */
|
||||||
private void applyColorExtraction(DropTarget.DragObject dragObject, int[] targetCell, int spanX,
|
private void applyColorExtractionOnWidget(DropTarget.DragObject dragObject, int[] targetCell,
|
||||||
int spanY) {
|
int spanX, int spanY) {
|
||||||
// Apply local extracted color if the DragView is an AppWidgetHostViewDrawable.
|
// Apply local extracted color if the DragView is an AppWidgetHostViewDrawable.
|
||||||
Drawable drawable = dragObject.dragView.getDrawable();
|
Drawable drawable = dragObject.dragView.getDrawable();
|
||||||
if (drawable instanceof AppWidgetHostViewDrawable) {
|
if (drawable instanceof AppWidgetHostViewDrawable) {
|
||||||
|
|||||||
Reference in New Issue
Block a user