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
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index 0130ba9..651b6f0 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -99,7 +99,7 @@
/** 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 @@
}
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 @@
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 @@
/**
* 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);
}
/**