summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Workspace.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher2/Workspace.java')
-rw-r--r--src/com/android/launcher2/Workspace.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index b4986add3..79fb4a9ae 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -1265,7 +1265,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
if (widgetInfo.spanX == -1) {
// Calculate the grid spans needed to fit this widget
- int[] spans = currentLayout.rectToCell(widgetInfo.minWidth, widgetInfo.minHeight);
+ int[] spans = currentLayout.rectToCell(widgetInfo.minWidth, widgetInfo.minHeight, null);
item.spanX = spans[0];
item.spanY = spans[1];
}
@@ -1430,6 +1430,13 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
return layout.findNearestVacantArea(mTempEstimate[0], mTempEstimate[1], spanX, spanY, mVacantCache, recycle);
}
+ /**
+ * Estimate the size that a child with the given dimensions will take in the current screen.
+ */
+ void estimateChildSize(int minWidth, int minHeight, int[] result) {
+ ((CellLayout)getChildAt(mCurrentScreen)).estimateChildSize(minWidth, minHeight, result);
+ }
+
void setLauncher(Launcher launcher) {
mLauncher = launcher;
}