diff options
author | Sebastián Franco <fransebas@google.com> | 2022-11-02 21:19:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-11-02 21:19:44 +0000 |
commit | ef24d5954c7906f165b5f351a77d6f9c798106c6 (patch) | |
tree | f21bf052d5466d20688ab257314aa29d3a4dccde /src/com/android/launcher3/CellLayout.java | |
parent | ccc8e9fcf4de1c6a7c183b3be0775b23db5adf19 (diff) | |
parent | c8392ea8810247825300d6bdb72dbddee99e7006 (diff) | |
download | Launcher3-ef24d5954c7906f165b5f351a77d6f9c798106c6.tar.gz |
Merge "Return the right radius to start reorder when dragging a Widget" into tm-qpr-dev
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r-- | src/com/android/launcher3/CellLayout.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 9d059bbb0e..e66d441912 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -938,7 +938,7 @@ public class CellLayout extends ViewGroup { cellToRect(targetCell[0], targetCell[1], spanX, spanY, cellBoundsWithSpacing); cellBoundsWithSpacing.inset(-mBorderSpace.x / 2, -mBorderSpace.y / 2); - if (canCreateFolder(getChildAt(targetCell[0], targetCell[1]))) { + if (canCreateFolder(getChildAt(targetCell[0], targetCell[1])) && spanX == 1 && spanY == 1) { // Take only the circle in the smaller dimension, to ensure we don't start reordering // too soon before accepting a folder drop. int minRadius = centerPoint[0] - cellBoundsWithSpacing.left; @@ -948,8 +948,9 @@ public class CellLayout extends ViewGroup { return minRadius; } // Take up the entire cell, including space between this cell and the adjacent ones. - return (float) Math.hypot(cellBoundsWithSpacing.width() / 2f, - cellBoundsWithSpacing.height() / 2f); + // Multiply by span to scale radius + return (float) Math.hypot(spanX * cellBoundsWithSpacing.width() / 2f, + spanY * cellBoundsWithSpacing.height() / 2f); } public int getCellWidth() { |