diff options
author | Ta-wei Yen <twyen@google.com> | 2016-03-17 19:32:07 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-03-17 19:32:07 +0000 |
commit | 0957354b2f25dcd8e4029390e877d91c8a898ec8 (patch) | |
tree | 9bb2188d0cb0ad6f9cab47a3e9be194f03f77faf /src/com/android/dialer/calllog | |
parent | 837ba261715813d9bde39a9861a0e99199b2ec82 (diff) | |
parent | ad39eb2ab71faf5c1750595e4fd8adcf898113f1 (diff) |
Prevent incorrect call log item from expanding when new item arrives am: fa15094
am: ad39eb2
* commit 'ad39eb2ab71faf5c1750595e4fd8adcf898113f1':
Prevent incorrect call log item from expanding when new item arrives
Diffstat (limited to 'src/com/android/dialer/calllog')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 13 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 64df877f8..3f41b1c1f 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -595,9 +595,10 @@ public class CallLogAdapter extends GroupingListAdapter // In case ViewHolders were added/removed, update the expanded position if the rowIds // match so that we can restore the correct expanded state on rebind. mCurrentlyExpandedPosition = position; + views.showActions(true); + } else { + views.showActions(false); } - - views.showActions(mCurrentlyExpandedPosition == position); views.updatePhoto(); mCallLogListItemHelper.setPhoneCallDetails(views, details); @@ -684,6 +685,14 @@ public class CallLogAdapter extends GroupingListAdapter } /** + * When the list is changing all stored position is no longer valid. + */ + public void invalidatePositions() { + mCurrentlyExpandedPosition = RecyclerView.NO_POSITION; + mHiddenPosition = RecyclerView.NO_POSITION; + } + + /** * When the user clicks "undo", the hidden item is unhidden. */ @Override diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index d258a8c46..d01537dea 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -217,6 +217,7 @@ public class CallLogFragment extends Fragment implements CallLogQueryHandler.Lis // Return false; we did not take ownership of the cursor return false; } + mAdapter.invalidatePositions(); mAdapter.setLoading(false); mAdapter.changeCursor(cursor); // This will update the state of the "Clear call log" menu item. |