summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Folder.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-03-01 16:09:54 -0800
committerWinson Chung <winsonc@google.com>2012-03-20 15:18:05 -0700
commit043f2af567178b82b0b41f12d379e7dd12da2936 (patch)
treefc097bc1c6baeee546d3683a2b8ecb05976e2370 /src/com/android/launcher2/Folder.java
parentd1eef3388a518696521ec8d67022c0bf09eef796 (diff)
downloadandroid_packages_apps_Trebuchet-043f2af567178b82b0b41f12d379e7dd12da2936.tar.gz
android_packages_apps_Trebuchet-043f2af567178b82b0b41f12d379e7dd12da2936.tar.bz2
android_packages_apps_Trebuchet-043f2af567178b82b0b41f12d379e7dd12da2936.zip
Adding fling-to-delete.
- Also fixing issue where the drop target icon changes color slower than the text. Change-Id: I0bfa59da5d202016342f1c3de419ebcafd81ff6f
Diffstat (limited to 'src/com/android/launcher2/Folder.java')
-rw-r--r--src/com/android/launcher2/Folder.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 07e76c9ef..3e8c4a3e7 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -22,6 +22,7 @@ import android.animation.ObjectAnimator;
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.Menu;
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 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
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 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
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