From 52112414bcc95394e537185316168dcdc943544f Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Fri, 27 Sep 2013 14:35:50 -0700 Subject: Disable drag and drop if the undo dialog for a favorite is showing Bug: 10955634 Change-Id: I1a562a03aa7a7de016687803c154b6a3915e3e10 --- src/com/android/dialer/list/PhoneFavoriteListView.java | 5 +++++ src/com/android/dialer/list/PhoneFavoritesTileAdapter.java | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/com/android/dialer/list/PhoneFavoriteListView.java b/src/com/android/dialer/list/PhoneFavoriteListView.java index 4e0b8ff0e..9160e3a9c 100644 --- a/src/com/android/dialer/list/PhoneFavoriteListView.java +++ b/src/com/android/dialer/list/PhoneFavoriteListView.java @@ -325,6 +325,11 @@ public class PhoneFavoriteListView extends ListView implements SwipeHelperCallba } final ContactTileRow tile = (ContactTileRow) child; + + if (tile.getTileAdapter().hasPotentialRemoveEntryIndex()) { + return false; + } + final int itemIndex = tile.getItemIndex(x, y); if (itemIndex != -1 && mOnDragDropListener != null) { final PhoneFavoriteTileView tileView = diff --git a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java index ae9414a4a..ce18a2b87 100644 --- a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java +++ b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java @@ -667,6 +667,10 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements mPotentialRemoveEntryIndex = -1; } + public boolean hasPotentialRemoveEntryIndex() { + return isIndexInBound(mPotentialRemoveEntryIndex); + } + /** * Clears all temporary variables at a new interaction. */ -- cgit v1.2.3