summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-07-21 19:01:11 -0700
committerWinson Chung <winsonc@google.com>2011-07-21 19:02:04 -0700
commit40e882bf19a837ee62ec328c5748b75be7960d39 (patch)
treee33e9d295990a1ffc09e3f48e8eec35ec0784a22
parentfaea1f816ead0033e52b730ab4dd598d2c186168 (diff)
downloadpackages_apps_trebuchet-40e882bf19a837ee62ec328c5748b75be7960d39.zip
packages_apps_trebuchet-40e882bf19a837ee62ec328c5748b75be7960d39.tar.gz
packages_apps_trebuchet-40e882bf19a837ee62ec328c5748b75be7960d39.tar.bz2
Fixing issue where items dragged from the dock would fly down below.
Change-Id: I99cabcccc08d69ddc5295454bd57bdc76ec3e5fb
-rw-r--r--src/com/android/launcher2/Workspace.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 66bb2ab..e379a43 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -2244,7 +2244,9 @@ public class Workspace extends SmoothPagedView
if (continueDrop && dropTargetLayout != null) {
// Move internally
- long container = mLauncher.isHotseatLayout(dropTargetLayout) ?
+ boolean hasMovedLayouts = (getParentCellLayoutForView(cell) != dropTargetLayout);
+ boolean hasMovedIntoHotseat = mLauncher.isHotseatLayout(dropTargetLayout);
+ long container = hasMovedIntoHotseat ?
LauncherSettings.Favorites.CONTAINER_HOTSEAT :
LauncherSettings.Favorites.CONTAINER_DESKTOP;
int screen = (mTargetCell[0] < 0) ?
@@ -2257,8 +2259,7 @@ public class Workspace extends SmoothPagedView
mDragViewVisualCenter[1], spanX, spanY, dropTargetLayout, mTargetCell);
// If the item being dropped is a shortcut and the nearest drop
// cell also contains a shortcut, then create a folder with the two shortcuts.
- boolean dropInscrollArea = mCurrentPage != screen && screen > -1;
-
+ boolean dropInscrollArea = hasMovedLayouts && !hasMovedIntoHotseat;
if (!dropInscrollArea && createUserFolderIfNecessary(cell, container,
dropTargetLayout, mTargetCell, false, d.dragView, null)) {
return;
@@ -2280,7 +2281,7 @@ public class Workspace extends SmoothPagedView
if (mTargetCell[0] >= 0 && mTargetCell[1] >= 0) {
- if (screen != mDragInfo.screen) {
+ if (hasMovedLayouts) {
// Reparent the view
getParentCellLayoutForView(cell).removeView(cell);
addInScreen(cell, container, screen, mTargetCell[0], mTargetCell[1],