diff options
author | Nancy Chen <nancychen@google.com> | 2014-09-23 16:00:09 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-09-23 16:00:09 -0700 |
commit | ce260ab8fc946cbe66023e2fa0a0e9cf3e915902 (patch) | |
tree | 0b2b1891e9946b1c69ba77d3621d25d866e3f495 /src/com/android/dialer/list/PhoneFavoriteTileView.java | |
parent | f2d3bd5d0fc9fd8e28f440fce7489691e0aee46b (diff) |
Drag and drop for PhoneFavoriteTileView but not when dialpad is open
Drag actions were disabled for PhoneFavoriteTileView when fixing a bug
that caused dragging when the dialpad was up. This CL restores the
original functionality while fixing the dialpad bug.
Bug: 17626737
Change-Id: I3a352088ff44c81230677d771479e367c9fe7856
Diffstat (limited to 'src/com/android/dialer/list/PhoneFavoriteTileView.java')
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteTileView.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteTileView.java b/src/com/android/dialer/list/PhoneFavoriteTileView.java index 2aedd9479..56d0b5d22 100644 --- a/src/com/android/dialer/list/PhoneFavoriteTileView.java +++ b/src/com/android/dialer/list/PhoneFavoriteTileView.java @@ -56,7 +56,11 @@ 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 - static final ClipData EMPTY_CLIP_DATA = ClipData.newPlainText("", ""); + private static final ClipData EMPTY_CLIP_DATA = ClipData.newPlainText("", ""); + + // Constant to pass to the drag event so that the drag action only happens when a phone favorite + // tile is long pressed. + static final String DRAG_PHONE_FAVORITE_TILE = "PHONE_FAVORITE_TILE"; public PhoneFavoriteTileView(Context context, AttributeSet attrs) { super(context, attrs); @@ -72,7 +76,8 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { public boolean onLongClick(View v) { final PhoneFavoriteTileView view = (PhoneFavoriteTileView) v; // NOTE The drag shadow is handled in the ListView. - view.startDrag(EMPTY_CLIP_DATA, new View.DragShadowBuilder(), null, 0); + view.startDrag(EMPTY_CLIP_DATA, new View.DragShadowBuilder(), + DRAG_PHONE_FAVORITE_TILE, 0); return true; } }); |