summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-07-20 20:42:13 -0700
committerWinson Chung <winsonc@google.com>2011-07-20 20:44:48 -0700
commitec9a0a4ca5458e65ba2498e4f7eab0ae6e91964a (patch)
tree372c4ee65b925bfef8e4f1735a732678718f2d9d
parentfc53cd22c9a78708c78c85946443f23ec8c59502 (diff)
downloadandroid_packages_apps_Trebuchet-ec9a0a4ca5458e65ba2498e4f7eab0ae6e91964a.tar.gz
android_packages_apps_Trebuchet-ec9a0a4ca5458e65ba2498e4f7eab0ae6e91964a.tar.bz2
android_packages_apps_Trebuchet-ec9a0a4ca5458e65ba2498e4f7eab0ae6e91964a.zip
Fixing small bug where folder could not be created in dock.
- Ensuring default workspace items aren't overlapping. Change-Id: I53803bdd61e1e956b9582b1332cde37663cb8578
-rw-r--r--res/xml/default_workspace.xml6
-rw-r--r--src/com/android/launcher2/Workspace.java8
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" />
<favorite
launcher:packageName="com.android.contacts"
launcher:className="com.android.contacts.activities.PeopleActivity"
launcher:container="-101"
launcher:screen="2"
- launcher:x="0"
+ launcher:x="2"
launcher:y="0" />
<favorite
launcher:packageName="com.android.browser"
launcher:className="com.android.browser.BrowserActivity"
launcher:container="-101"
launcher:screen="3"
- launcher:x="0"
+ launcher:x="3"
launcher:y="0" />
</favorites>
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;