diff options
author | Yorke Lee <yorkelee@google.com> | 2014-09-10 15:01:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-10 15:01:34 +0000 |
commit | f08f8ba83f61001c15c5619734b9f66d2a6e700b (patch) | |
tree | 6b52bde9c99214407368f5cbacc9e9d8164f9067 | |
parent | 29ae4ae721a1f6d89a8fdca0fd4d49a1e5ecc4a7 (diff) | |
parent | d5f58da1c9d39983e0fae90893b2292d259ca3b7 (diff) |
Merge "Fix drag events transfering through dialpad" into lmp-dev
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteListView.java | 5 | ||||
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteTileView.java | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteListView.java b/src/com/android/dialer/list/PhoneFavoriteListView.java index 4ecc1cd90..667681e01 100644 --- a/src/com/android/dialer/list/PhoneFavoriteListView.java +++ b/src/com/android/dialer/list/PhoneFavoriteListView.java @@ -149,6 +149,11 @@ public class PhoneFavoriteListView extends GridView implements OnDragDropListene final int eY = (int) event.getY(); switch (action) { case DragEvent.ACTION_DRAG_STARTED: { + if (PhoneFavoriteTileView.EMPTY_CLIP_DATA != event.getClipData()) { + // Ignore any drag events that were not propagated by long pressing + // on a {@link PhoneFavoriteTileView} + return false; + } if (!mDragDropController.handleDragStarted(eX, eY)) { return false; } diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java index 208e3507d..2aedd9479 100644 --- a/src/com/android/dialer/list/PhoneFavoriteTileView.java +++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java @@ -56,7 +56,7 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { // Dummy clip data object that is attached to drag shadows so that text views // don't crash with an NPE if the drag shadow is released in their bounds - private static final ClipData EMPTY_CLIP_DATA = ClipData.newPlainText("", ""); + static final ClipData EMPTY_CLIP_DATA = ClipData.newPlainText("", ""); public PhoneFavoriteTileView(Context context, AttributeSet attrs) { super(context, attrs); |