Adding fling-to-delete.

- Also fixing issue where the drop target icon changes color slower than the text.

Change-Id: I0bfa59da5d202016342f1c3de419ebcafd81ff6f
This commit is contained in:
Winson Chung
2012-03-01 16:09:54 -08:00
parent d1eef3388a
commit 043f2af567
12 changed files with 416 additions and 44 deletions

View File

@@ -18,7 +18,7 @@ package com.android.launcher2;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Paint;
import android.graphics.PointF;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.TextView;
@@ -71,6 +71,10 @@ public class ButtonDropTarget extends TextView implements DropTarget, DragContro
public void onDrop(DragObject d) {
}
public void onFlingToDelete(DragObject d, int x, int y, PointF vec) {
// Do nothing
}
public void onDragEnter(DragObject d) {
d.dragView.setColor(mHoverColor);
}