diff options
author | Patrick Dubroy <dubroy@google.com> | 2010-08-17 15:11:18 -0700 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2010-08-18 17:57:59 -0700 |
commit | 4ed6278e518cc6894cb150b606382e8e6a012599 (patch) | |
tree | cc6c7fac56a0ac8bde4004c4f1dc868f170e5dbd /src/com/android/launcher2/DragController.java | |
parent | f07e7a441c5de51d095f54d2735b7c028f217e8e (diff) | |
download | android_packages_apps_Trebuchet-4ed6278e518cc6894cb150b606382e8e6a012599.tar.gz android_packages_apps_Trebuchet-4ed6278e518cc6894cb150b606382e8e6a012599.tar.bz2 android_packages_apps_Trebuchet-4ed6278e518cc6894cb150b606382e8e6a012599.zip |
Implement button to get application info for an app shortcut.
For now, it's just a drag target like the delete zone. Once all apps
and the home screen support a selection mode, this (and delete) will
be implemented as buttons in the Contextual Action Bar.
Change-Id: I6bf43d03eefda672ea34c583a7021137da22b184
Diffstat (limited to 'src/com/android/launcher2/DragController.java')
-rw-r--r-- | src/com/android/launcher2/DragController.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index 0130ba93c..651b6f0b2 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -99,7 +99,7 @@ public class DragController { /** Who can receive drop events */ private ArrayList<DropTarget> mDropTargets = new ArrayList<DropTarget>(); - private DragListener mListener; + private ArrayList<DragListener> mListeners = new ArrayList<DragListener>(); /** The window token used as the parent for the DragView. */ private IBinder mWindowToken; @@ -213,8 +213,8 @@ public class DragController { } mInputMethodManager.hideSoftInputFromWindow(mWindowToken, 0); - if (mListener != null) { - mListener.onDragStart(source, dragInfo, dragAction); + for (DragListener listener : mListeners) { + listener.onDragStart(source, dragInfo, dragAction); } int registrationX = ((int)mMotionDownX) - screenX; @@ -297,8 +297,8 @@ public class DragController { if (mOriginator != null) { mOriginator.setVisibility(View.VISIBLE); } - if (mListener != null) { - mListener.onDragEnd(); + for (DragListener listener : mListeners) { + listener.onDragEnd(); } if (mDragView != null) { mDragView.remove(); @@ -547,15 +547,15 @@ public class DragController { /** * Sets the drag listner which will be notified when a drag starts or ends. */ - public void setDragListener(DragListener l) { - mListener = l; + public void addDragListener(DragListener l) { + mListeners.add(l); } /** * Remove a previously installed drag listener. */ public void removeDragListener(DragListener l) { - mListener = null; + mListeners.remove(l); } /** |