Adding fling-to-delete.
- Also fixing issue where the drop target icon changes color slower than the text.
Change-Id: I0bfa59da5d202016342f1c3de419ebcafd81ff6f
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 07e76c9..3e8c4a3 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -22,6 +22,7 @@
import android.animation.PropertyValuesHolder;
import android.content.Context;
import android.content.res.Resources;
+import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.text.InputType;
@@ -35,7 +36,6 @@
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
-import android.view.View.MeasureSpec;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.inputmethod.EditorInfo;
@@ -653,6 +653,10 @@
updateItemLocationsInDatabase();
}
+ public boolean supportsFlingToDelete() {
+ return true;
+ }
+
private void updateItemLocationsInDatabase() {
ArrayList<View> list = getItemsInReadingOrder();
for (int i = 0; i < list.size(); i++) {
@@ -924,6 +928,10 @@
mInfo.add(item);
}
+ public void onFlingToDelete(DragObject d, int x, int y, PointF vec) {
+ // Do nothing
+ }
+
public void onAdd(ShortcutInfo item) {
mItemsInvalidated = true;
// If the item was dropped onto this open folder, we have done the work associated