+ * @Override
+ * public boolean dispatchKeyEvent(KeyEvent event) {
+ * return mDragController.dispatchKeyEvent(this, event)
+ * || super.dispatchKeyEvent(event);
+ *
+ */
+ public boolean dispatchKeyEvent(KeyEvent event) {
+ return mDragging;
+ }
+
+ private void endDrag() {
+ if (mDragging) {
+ mDragging = false;
+ if (mOriginator != null) {
+ mOriginator.setVisibility(View.VISIBLE);
+ }
+ if (mListener != null) {
+ mListener.onDragEnd();
+ }
+ if (mDragView != null) {
+ mDragView.remove();
+ mDragView = null;
+ }
+ if (mDragBitmap != null) {
+ mDragBitmap.recycle();
+ mDragBitmap = null;
+ }
+ }
+ }
+
+ /**
+ * Call this from a drag source view.
+ */
+ public boolean onInterceptTouchEvent(MotionEvent ev) {
+ final int action = ev.getAction();
+
+ final float screenX = ev.getRawX();
+ final float screenY = ev.getRawY();
+
+ switch (action) {
+ case MotionEvent.ACTION_MOVE:
+ break;
+
+ case MotionEvent.ACTION_DOWN:
+ // Remember location of down touch
+ mMotionDownX = screenX;
+ mMotionDownY = screenY;
+ mLastDropTarget = null;
+ break;
+
+ case MotionEvent.ACTION_CANCEL:
+ case MotionEvent.ACTION_UP:
+ if (mDragging) {
+ drop(screenX, screenY);
+ }
+ endDrag();
+ break;
+ }
+
+ return mDragging;
+ }
+
+ /**
+ * Call this from a drag source view.
+ */
+ public boolean onTouchEvent(MotionEvent ev) {
+ View scrollView = mScrollView;
+
+ if (!mDragging) {
+ return false;
+ }
+
+ final int action = ev.getAction();
+ final float x = ev.getRawX();
+ final float y = ev.getRawY();
+
+ switch (action) {
+ case MotionEvent.ACTION_DOWN:
+
+ // Remember where the motion event started
+ mMotionDownX = x;
+ mMotionDownY = y;
+
+ if ((x < SCROLL_ZONE) || (x > scrollView.getWidth() - SCROLL_ZONE)) {
+ mScrollState = SCROLL_WAITING_IN_ZONE;
+ mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
+ } else {
+ mScrollState = SCROLL_OUTSIDE_ZONE;
+ }
+
+ break;
+ case MotionEvent.ACTION_MOVE:
+ // Update the drag view.
+ mDragView.move((int)ev.getRawX(), (int)ev.getRawY());
+
+ // Drop on someone?
+ final int[] coordinates = mCoordinatesTemp;
+ DropTarget dropTarget = findDropTarget((int) x, (int) y, coordinates);
+ if (dropTarget != null) {
+ if (mLastDropTarget == dropTarget) {
+ dropTarget.onDragOver(mDragSource, coordinates[0], coordinates[1],
+ (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+ } else {
+ if (mLastDropTarget != null) {
+ mLastDropTarget.onDragExit(mDragSource, coordinates[0], coordinates[1],
+ (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+ }
+ dropTarget.onDragEnter(mDragSource, coordinates[0], coordinates[1],
+ (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+ }
+ } else {
+ if (mLastDropTarget != null) {
+ mLastDropTarget.onDragExit(mDragSource, coordinates[0], coordinates[1],
+ (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+ }
+ }
+ mLastDropTarget = dropTarget;
+
+ // Scroll, maybe, but not if we're in the delete region.
+ boolean inDeleteRegion = false;
+ if (mDeleteRegion != null) {
+ inDeleteRegion = mDeleteRegion.contains(ev.getRawX(), ev.getRawY());
+ }
+ if (!inDeleteRegion && x < SCROLL_ZONE) {
+ if (mScrollState == SCROLL_OUTSIDE_ZONE) {
+ mScrollState = SCROLL_WAITING_IN_ZONE;
+ mScrollRunnable.setDirection(SCROLL_LEFT);
+ mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
+ }
+ } else if (!inDeleteRegion && x > scrollView.getWidth() - SCROLL_ZONE) {
+ if (mScrollState == SCROLL_OUTSIDE_ZONE) {
+ mScrollState = SCROLL_WAITING_IN_ZONE;
+ mScrollRunnable.setDirection(SCROLL_RIGHT);
+ mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
+ }
+ } else {
+ if (mScrollState == SCROLL_WAITING_IN_ZONE) {
+ mScrollState = SCROLL_OUTSIDE_ZONE;
+ mScrollRunnable.setDirection(SCROLL_RIGHT);
+ mHandler.removeCallbacks(mScrollRunnable);
+ }
+ }
+
+ break;
+ case MotionEvent.ACTION_UP:
+ mHandler.removeCallbacks(mScrollRunnable);
+ if (mDragging) {
+ drop(x, y);
+ }
+ endDrag();
+
+ break;
+ case MotionEvent.ACTION_CANCEL:
+ endDrag();
+ }
+
+ return true;
+ }
+
+ private boolean drop(float x, float y) {
+ final int[] coordinates = mCoordinatesTemp;
+ DropTarget dropTarget = findDropTarget((int) x, (int) y, coordinates);
+
+ if (dropTarget != null) {
+ dropTarget.onDragExit(mDragSource, coordinates[0], coordinates[1],
+ (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+ if (dropTarget.acceptDrop(mDragSource, coordinates[0], coordinates[1],
+ (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo)) {
+ dropTarget.onDrop(mDragSource, coordinates[0], coordinates[1],
+ (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
+ mDragSource.onDropCompleted((View) dropTarget, true);
+ return true;
+ } else {
+ mDragSource.onDropCompleted((View) dropTarget, false);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private DropTarget findDropTarget(int x, int y, int[] dropCoordinates) {
+ final Rect r = mRectTemp;
+
+ final ArrayList
+ * The registration point is the point inside our view that the touch events should
+ * be centered upon.
+ *
+ * @param context A context
+ * @param bitmap The view that we're dragging around. We scale it up when we draw it.
+ * @param registrationX The x coordinate of the registration point.
+ * @param registrationY The y coordinate of the registration point.
+ */
+ public DragView(Context context, Bitmap bitmap, int registrationX, int registrationY) {
+ super(context);
+
+ mWindowManager = WindowManagerImpl.getDefault();
+
+ mTween = new SymmetricalLinearTween(false, 110 /*ms duration*/, this);
+
+ int width = bitmap.getWidth();
+ int height = bitmap.getHeight();
+
+ Matrix scale = new Matrix();
+ float scaleFactor = width;
+ scaleFactor = mScale = (scaleFactor + DRAG_SCALE) / scaleFactor;
+ scale.setScale(scaleFactor, scaleFactor);
+
+ mBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, scale, true);
+
+ // The point in our scaled bitmap that the touch events are located
+ mRegistrationX = registrationX + (DRAG_SCALE / 2);
+ mRegistrationY = registrationY + (DRAG_SCALE / 2);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int widthSize = resolveSize(mBitmap.getWidth(), widthMeasureSpec);
+ int heightSize = resolveSize(mBitmap.getHeight(), heightMeasureSpec);
+ setMeasuredDimension(widthSize, heightSize);
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ if (false) {
+ // for debugging
+ Paint p = new Paint();
+ p.setStyle(Paint.Style.FILL);
+ p.setColor(0xaaffffff);
+ canvas.drawRect(0, 0, getWidth(), getHeight(), p);
+ }
+ float scale = mAnimationScale;
+ if (scale < 0.999f) { // allow for some float error
+ float width = mBitmap.getWidth();
+ float offset = (width-(width*scale))/2;
+ canvas.translate(offset, offset);
+ canvas.scale(scale, scale);
+ }
+ canvas.drawBitmap(mBitmap, 0.0f, 0.0f, mPaint);
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ mBitmap.recycle();
+ }
+
+ public void onTweenValueChanged(float value, float oldValue) {
+ mAnimationScale = (1.0f+((mScale-1.0f)*value))/mScale;
+ invalidate();
+ }
+
+ public void onTweenStarted() {
+ }
+
+ public void onTweenFinished() {
+ }
+
+ public void setPaint(Paint paint) {
+ mPaint = paint;
+ invalidate();
+ }
+
+ /**
+ * Create a window containing this view and show it.
+ *
+ * @param windowToken obtained from v.getWindowToken() from one of your views
+ * @param touchX the x coordinate the user touched in screen coordinates
+ * @param touchY the y coordinate the user touched in screen coordinates
+ */
+ public void show(IBinder windowToken, int touchX, int touchY) {
+ WindowManager.LayoutParams lp;
+ int pixelFormat;
+
+ pixelFormat = PixelFormat.TRANSLUCENT;
+
+ lp = new WindowManager.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ touchX-mRegistrationX, touchY-mRegistrationY,
+ WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL,
+ WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
+ | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
+ /*| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM*/,
+ pixelFormat);
+// lp.token = mStatusBarView.getWindowToken();
+ lp.gravity = Gravity.LEFT | Gravity.TOP;
+ lp.token = windowToken;
+ lp.setTitle("DragView");
+ mLayoutParams = lp;
+
+ mWindowManager.addView(this, lp);
+
+ mAnimationScale = 1.0f/mScale;
+ mTween.start(true);
+ }
+
+ /**
+ * Move the window containing this view.
+ *
+ * @param touchX the x coordinate the user touched in screen coordinates
+ * @param touchY the y coordinate the user touched in screen coordinates
+ */
+ void move(int touchX, int touchY) {
+ WindowManager.LayoutParams lp = mLayoutParams;
+ lp.x = touchX - mRegistrationX;
+ lp.y = touchY - mRegistrationY;
+ mWindowManager.updateViewLayout(this, lp);
+ }
+
+ void remove() {
+ mWindowManager.removeView(this);
+ }
+}
+
diff --git a/src/com/android/launcher2/DropTarget.java b/src/com/android/launcher2/DropTarget.java
index e092e50957..72eb330948 100644
--- a/src/com/android/launcher2/DropTarget.java
+++ b/src/com/android/launcher2/DropTarget.java
@@ -30,18 +30,25 @@ public interface DropTarget {
* @param source DragSource where the drag started
* @param x X coordinate of the drop location
* @param y Y coordinate of the drop location
- * @param xOffset Horizontal offset with the object being dragged where the original touch happened
- * @param yOffset Vertical offset with the object being dragged where the original touch happened
+ * @param xOffset Horizontal offset with the object being dragged where the original
+ * touch happened
+ * @param yOffset Vertical offset with the object being dragged where the original
+ * touch happened
+ * @param dragView The DragView that's being dragged around on screen.
* @param dragInfo Data associated with the object being dragged
*
*/
- void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
- void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
- void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
- void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
/**
* Check if a drop action can occur at, or near, the requested location.
@@ -55,10 +62,12 @@ public interface DropTarget {
* original touch happened
* @param yOffset Vertical offset with the object being dragged where the
* original touch happened
+ * @param dragView The DragView that's being dragged around on screen.
* @param dragInfo Data associated with the object being dragged
* @return True if the drop will be accepted, false otherwise.
*/
- boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
/**
* Estimate the surface area where this object would land if dropped at the
@@ -71,11 +80,19 @@ public interface DropTarget {
* original touch happened
* @param yOffset Vertical offset with the object being dragged where the
* original touch happened
+ * @param dragView The DragView that's being dragged around on screen.
* @param dragInfo Data associated with the object being dragged
* @param recycle {@link Rect} object to be possibly recycled.
* @return Estimated area that would be occupied if object was dropped at
* the given location. Should return null if no estimate is found,
* or if this target doesn't provide estimations.
*/
- Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo, Rect recycle);
+ Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo, Rect recycle);
+
+ // These methods are implemented in Views
+ void getHitRect(Rect outRect);
+ void getLocationOnScreen(int[] loc);
+ int getLeft();
+ int getTop();
}
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 6281ebf989..bc5f9fd3b2 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -35,7 +35,7 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
OnItemClickListener, OnClickListener, View.OnLongClickListener {
protected AbsListView mContent;
- protected DragController mDragger;
+ protected DragController mDragController;
protected Launcher mLauncher;
@@ -98,7 +98,7 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
app = new ApplicationInfo(app);
}
- mDragger.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
+ mDragController.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
mLauncher.closeFolder(this);
mDragItem = app;
@@ -109,8 +109,8 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
mCloneInfo = cloneInfo;
}
- public void setDragger(DragController dragger) {
- mDragger = dragger;
+ public void setDragController(DragController dragController) {
+ mDragController = dragController;
}
public void onDropCompleted(View target, boolean success) {
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index 1531538fb9..85fc3a7547 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -62,7 +62,7 @@ public class FolderIcon extends BubbleTextView implements DropTarget {
}
public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
- Object dragInfo) {
+ DragView dragView, Object dragInfo) {
final ItemInfo item = (ItemInfo) dragInfo;
final int itemType = item.itemType;
return (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
@@ -70,11 +70,13 @@ public class FolderIcon extends BubbleTextView implements DropTarget {
&& item.container != mInfo.id;
}
- public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo, Rect recycle) {
+ public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo, Rect recycle) {
return null;
}
- public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
+ public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo) {
final ApplicationInfo item = (ApplicationInfo) dragInfo;
// TODO: update open folder that is looking at this data
mInfo.add(item);
@@ -82,16 +84,16 @@ public class FolderIcon extends BubbleTextView implements DropTarget {
}
public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
- Object dragInfo) {
+ DragView dragView, Object dragInfo) {
setCompoundDrawablesWithIntrinsicBounds(null, mOpenIcon, null, null);
}
public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
- Object dragInfo) {
+ DragView dragView, Object dragInfo) {
}
public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
- Object dragInfo) {
+ DragView dragView, Object dragInfo) {
setCompoundDrawablesWithIntrinsicBounds(null, mCloseIcon, null, null);
}
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 661fbdb774..759af285cc 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -166,6 +166,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
private LayoutInflater mInflater;
+ private DragController mDragController;
private DragLayer mDragLayer;
private WallpaperView mWallpaperView;
private Workspace mWorkspace;
@@ -528,10 +529,14 @@ public final class Launcher extends Activity implements View.OnClickListener, On
* Finds all the views we need and configure them properly.
*/
private void setupViews() {
+ mDragController = new DragController(this);
+ DragController dragController = mDragController;
+
mDragLayer = (DragLayer) findViewById(R.id.drag_layer);
final DragLayer dragLayer = mDragLayer;
+ dragLayer.setDragController(dragController);
- mWallpaperView = (WallpaperView) dragLayer.findViewById(R.id.wallpaper);
+ mWallpaperView = (WallpaperView) findViewById(R.id.wallpaper);
final WallpaperView wallpaper = mWallpaperView;
mWorkspace = (Workspace) dragLayer.findViewById(R.id.workspace);
@@ -546,7 +551,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
mHandleIcon.setCrossFadeEnabled(true);
workspace.setOnLongClickListener(this);
- workspace.setDragger(dragLayer);
+ workspace.setDragController(dragController);
workspace.setLauncher(this);
workspace.setWallpaper(wallpaper);
@@ -554,12 +559,16 @@ public final class Launcher extends Activity implements View.OnClickListener, On
wallpaper.setScreenCount(workspace.getScreenCount());
deleteZone.setLauncher(this);
- deleteZone.setDragController(dragLayer);
+ deleteZone.setDragController(dragController);
deleteZone.setHandle(mHandleView);
- // TODO dragLayer.setIgnoredDropTarget(grid);
- dragLayer.setDragScoller(workspace);
- dragLayer.setDragListener(deleteZone);
+ dragController.setDragScoller(workspace);
+ dragController.setDragListener(deleteZone);
+ dragController.setScrollView(dragLayer);
+
+ // The order here is bottom to top.
+ dragController.addDropTarget(workspace);
+ dragController.addDropTarget(deleteZone);
}
/**
@@ -1347,6 +1356,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
ViewGroup parent = (ViewGroup) folder.getParent();
if (parent != null) {
parent.removeView(folder);
+ mDragController.removeDropTarget((DropTarget)folder);
}
folder.onClose();
}
@@ -1545,10 +1555,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
}
}
- DragController getDragController() {
- return mDragLayer;
- }
-
/**
* Launches the intent referred by the clicked shortcut.
*
@@ -1646,7 +1652,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
return;
}
- openFolder.setDragger(mDragLayer);
+ openFolder.setDragController(mDragController);
openFolder.setLauncher(this);
openFolder.bind(folderInfo);
@@ -1703,11 +1709,6 @@ public final class Launcher extends Activity implements View.OnClickListener, On
return sModel;
}
- void closeAllApplications() {
- // TODO mDrawer.close();
- mAllAppsDialog.dismiss();
- }
-
View getDrawerHandle() {
return mHandleView;
}
@@ -1744,6 +1745,7 @@ public final class Launcher extends Activity implements View.OnClickListener, On
protected void onPrepareDialog(int id, Dialog dialog) {
switch (id) {
case DIALOG_ALL_APPS:
+ mAllAppsGrid.onPrepareDialog();
break;
case DIALOG_CREATE_SHORTCUT:
break;
@@ -1886,8 +1888,11 @@ public final class Launcher extends Activity implements View.OnClickListener, On
setContentView(R.layout.all_apps);
AllAppsGridView grid = mAllAppsGrid = (AllAppsGridView)findViewById(R.id.all_apps);
+ DragLayer dragLayer = (DragLayer)findViewById(R.id.drag_layer);
+ dragLayer.setDragController(mDragController);
+
grid.setTextFilterEnabled(false);
- // TODO grid.setDragger(dragLayer);
+ grid.setDragController(mDragController);
grid.setLauncher(Launcher.this);
}
@@ -1930,7 +1935,11 @@ public final class Launcher extends Activity implements View.OnClickListener, On
mWorkspace.hide();
}
- private void closeAllAppsDialog(boolean animated) {
+ void showWorkspace() {
+ mWorkspace.show();
+ }
+
+ void closeAllAppsDialog(boolean animated) {
if (mAllAppsDialog.isOpen) {
if (animated) {
// TODO mDrawer.animateClose();
diff --git a/src/com/android/launcher2/LiveFolderIcon.java b/src/com/android/launcher2/LiveFolderIcon.java
index 4e1904102b..1876f2e0c7 100644
--- a/src/com/android/launcher2/LiveFolderIcon.java
+++ b/src/com/android/launcher2/LiveFolderIcon.java
@@ -54,23 +54,28 @@ public class LiveFolderIcon extends FolderIcon {
}
@Override
- public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
+ public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo) {
return false;
}
@Override
- public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
+ public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo) {
}
@Override
- public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
+ public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo) {
}
@Override
- public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
+ public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo) {
}
@Override
- public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
+ public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo) {
}
}
diff --git a/src/com/android/launcher2/UserFolder.java b/src/com/android/launcher2/UserFolder.java
index a5e90587e2..1379be6d09 100644
--- a/src/com/android/launcher2/UserFolder.java
+++ b/src/com/android/launcher2/UserFolder.java
@@ -28,31 +28,36 @@ public class UserFolder extends Folder implements DropTarget {
}
public boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
- Object dragInfo) {
+ DragView dragView, Object dragInfo) {
final ItemInfo item = (ItemInfo) dragInfo;
final int itemType = item.itemType;
return (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) && item.container != mInfo.id;
}
- public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo, Rect recycle) {
+ public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo, Rect recycle) {
return null;
}
- public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
+ public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo) {
final ApplicationInfo item = (ApplicationInfo) dragInfo;
//noinspection unchecked
((ArrayAdapter