From ec9a0a4ca5458e65ba2498e4f7eab0ae6e91964a Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 20 Jul 2011 20:42:13 -0700 Subject: Fixing small bug where folder could not be created in dock. - Ensuring default workspace items aren't overlapping. Change-Id: I53803bdd61e1e956b9582b1332cde37663cb8578 --- res/xml/default_workspace.xml | 6 +++--- src/com/android/launcher2/Workspace.java | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/res/xml/default_workspace.xml b/res/xml/default_workspace.xml index 9189c76e4..0e96a6771 100644 --- a/res/xml/default_workspace.xml +++ b/res/xml/default_workspace.xml @@ -45,21 +45,21 @@ launcher:className="com.android.contacts.activities.DialtactsActivity" launcher:container="-101" launcher:screen="1" - launcher:x="0" + launcher:x="1" launcher:y="0" /> diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 5309423b7..b86fa4148 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -2120,8 +2120,12 @@ public class Workspace extends SmoothPagedView boolean createUserFolderIfNecessary(View newView, long container, CellLayout target, int[] targetCell, boolean external, DragView dragView, Runnable postAnimationRunnable) { View v = target.getChildAt(targetCell[0], targetCell[1]); - boolean hasntMoved = mDragInfo != null - && (mDragInfo.cellX == targetCell[0] && mDragInfo.cellY == targetCell[1]); + boolean hasntMoved = false; + if (mDragInfo != null) { + CellLayout cellParent = getParentCellLayoutForView(mDragInfo.cell); + hasntMoved = (mDragInfo.cellX == targetCell[0] && + mDragInfo.cellY == targetCell[1]) && (cellParent == target); + } if (v == null || hasntMoved || !mCreateUserFolderOnDrop) return false; mCreateUserFolderOnDrop = false; -- cgit v1.2.3