Make Launcher more forgiving when dragging desktop items.
This change adds nearby-area searching when dragging desktop items into already-occupied cells. This approach tries harder to find a matching area, instead of strictly rejecting invalid moves.
We also draw a "snag" during the drag to show where an item would be dropped, but only if we would drop into an alternative cell. This gives users better feedback about where things will drop.
http://b/issue?id=1634887
diff --git a/src/com/android/launcher/DeleteZone.java b/src/com/android/launcher/DeleteZone.java
index 7f92c23..02e8011 100644
--- a/src/com/android/launcher/DeleteZone.java
+++ b/src/com/android/launcher/DeleteZone.java
@@ -19,6 +19,7 @@
import android.widget.ImageView;
import android.content.Context;
import android.content.res.TypedArray;
+import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.TranslateAnimation;
@@ -77,6 +78,10 @@
Object dragInfo) {
return true;
}
+
+ public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo, Rect recycle) {
+ return null;
+ }
public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
final ItemInfo item = (ItemInfo) dragInfo;