diff options
-rw-r--r-- | src/com/android/launcher2/DragController.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index 3c956f07f..d796fbe91 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -584,6 +584,8 @@ public class DragController { mDragSource.onDropCompleted((View) dropTarget, false); return true; } + } else { + mDragSource.onDropCompleted(null, false); } return false; } diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 3823cc1c0..eac9ebd28 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -56,6 +56,7 @@ import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; import android.util.Pair; +import android.view.Display; import android.view.DragEvent; import android.view.MotionEvent; import android.view.View; @@ -1768,6 +1769,14 @@ public class Workspace extends SmoothPagedView onDropExternal(x, y, dragInfo, cellLayout, false); } + @Override + public void getHitRect(Rect outRect) { + // We want the workspace to have the whole area of the display (it will find the correct + // cell layout to drop to in the existing drag/drop logic. + final Display d = mLauncher.getWindowManager().getDefaultDisplay(); + outRect.set(0, 0, d.getWidth(), d.getHeight()); + } + /** * Add the item specified by dragInfo to the given layout. * This is basically the equivalent of onDropExternal, except it's not initiated |