diff options
author | Yorke Lee <yorkelee@google.com> | 2013-12-03 18:30:38 -0800 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2014-03-01 17:39:20 +0000 |
commit | 61fe032af12ad13bba18eb7a807112a59e1e4776 (patch) | |
tree | 86fa9d68473a4e98feeb447fb4d2497b4e8a2105 | |
parent | b0b153f5fe5833d1a3b102e93e6e27481a90e4f7 (diff) |
Temporarily stop UI refresh during drag and drop
If the user is in the middle of a drag and drop operation, temporarily
stop UI refreshes when a new cursor is delivered, to prevent UI
inconsistencies.
This CL only fixes the dragging/dropping case. Swiping is still buggy
(the fix is more complicated/risky), and swiping might be removed
altogether in the future.
Bug: 11119329
Change-Id: I2939c915d4eb5d8f9de19a369b21c6c98806ba94
(cherry picked from commit 670fd3f59160bdb81f38b6be2f176ba233915686)
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoritesTileAdapter.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java index e28fd73f3..cd4fb00e2 100644 --- a/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java +++ b/src/com/android/dialer/list/PhoneFavoritesTileAdapter.java @@ -88,6 +88,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements private long mIdToKeepInPlace = -1; private boolean mAwaitingRemove = false; + private boolean mDelayCursorUpdates = false; private ContactPhotoManager mPhotoManager; protected int mNumFrequents; @@ -178,6 +179,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements * @param inDragging Boolean variable indicating whether there is a drag in process. */ public void setInDragging(boolean inDragging) { + mDelayCursorUpdates = inDragging; mInDragging = inDragging; } @@ -224,7 +226,7 @@ public class PhoneFavoritesTileAdapter extends BaseAdapter implements * Else use {@link ContactTileLoaderFactory} */ public void setContactCursor(Cursor cursor) { - if (cursor != null && !cursor.isClosed()) { + if (!mDelayCursorUpdates && cursor != null && !cursor.isClosed()) { mNumStarred = getNumStarredContacts(cursor); if (mAwaitingRemove) { mDataSetChangedListener.cacheOffsetsForDatasetChange(); |