Refactor of Launcher drag and drop to use a DragObject
-> DragObject contains a bunch of parameters instead of pssing
them each individually
Change-Id: I709cf320fe4234d71e19325d5c761dd9a9bba405
diff --git a/src/com/android/launcher2/IconDropTarget.java b/src/com/android/launcher2/IconDropTarget.java
index 4d018e6..a091f6c 100644
--- a/src/com/android/launcher2/IconDropTarget.java
+++ b/src/com/android/launcher2/IconDropTarget.java
@@ -82,32 +82,27 @@
mDragAndDropEnabled = enabled;
}
- public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
- DragView dragView, Object dragInfo) {
+ public boolean acceptDrop(DragObject d) {
return false;
}
- public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
- DragView dragView, Object dragInfo) {
+ public void onDrop(DragObject d) {
// Do nothing
}
- public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
- DragView dragView, Object dragInfo) {
+ public void onDragEnter(DragObject d) {
if (mDragAndDropEnabled) {
- dragView.setPaint(mHoverPaint);
+ d.dragView.setPaint(mHoverPaint);
}
}
- public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
- DragView dragView, Object dragInfo) {
+ public void onDragOver(DragObject d) {
// Do nothing
}
- public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
- DragView dragView, Object dragInfo) {
+ public void onDragExit(DragObject d) {
if (mDragAndDropEnabled) {
- dragView.setPaint(null);
+ d.dragView.setPaint(null);
}
}
@@ -135,8 +130,7 @@
}
@Override
- public DropTarget getDropTargetDelegate(DragSource source, int x, int y, int xOffset,
- int yOffset, DragView dragView, Object dragInfo) {
+ public DropTarget getDropTargetDelegate(DragObject d) {
return null;
}
}