diff options
author | Winson Chung <winsonc@google.com> | 2011-07-21 19:56:51 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-21 19:56:51 -0700 |
commit | 1228b3bc8e523ad07bcac602d89890690c9f06ef (patch) | |
tree | 057f8cdaf6d57ea74b8d4d90985b893aa6468fcd /src | |
parent | de1af7661548692d370518528ff91c7422b9c8ae (diff) | |
parent | 40e882bf19a837ee62ec328c5748b75be7960d39 (diff) | |
download | android_packages_apps_Trebuchet-1228b3bc8e523ad07bcac602d89890690c9f06ef.tar.gz android_packages_apps_Trebuchet-1228b3bc8e523ad07bcac602d89890690c9f06ef.tar.bz2 android_packages_apps_Trebuchet-1228b3bc8e523ad07bcac602d89890690c9f06ef.zip |
Merge "Fixing issue where items dragged from the dock would fly down below."
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 9913a6b3d..035d9ea4d 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -2259,7 +2259,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) ? @@ -2272,8 +2274,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; @@ -2295,7 +2296,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], |