diff options
author | Jin Cao <jinyan@google.com> | 2014-10-17 13:42:10 -0700 |
---|---|---|
committer | Jin Cao <jinyan@google.com> | 2014-10-17 16:19:37 -0700 |
commit | f9b96e244e6c6a19cb1920ff129f424997db2727 (patch) | |
tree | de7b0c1e45a7051ec8d07bd94217bde2fff7c99c /src/com/android/mail/browse/SwipeableConversationItemView.java | |
parent | 17553ce2afdf3f8be5e53a639ac8f2593e388fec (diff) | |
download | android_packages_apps_UnifiedEmail-f9b96e244e6c6a19cb1920ff129f424997db2727.tar.gz android_packages_apps_UnifiedEmail-f9b96e244e6c6a19cb1920ff129f424997db2727.tar.bz2 android_packages_apps_UnifiedEmail-f9b96e244e6c6a19cb1920ff129f424997db2727.zip |
Save the focused conversation via id instead of position
Don't rely on saving the position in the adapter because the position
might change as the adapter's data set changes (e.g. new mails via sync),
and we have no way of modifying the focused position accordingly.
Instead, save the focused conversation with its id (tried using the uri,
but the uri might change when the conversation gets cached). This way,
no matter what happens to the items in the adapter, the focused item
remains consistent.
b/18027602
Change-Id: I51aa68bc15c5892c3b34bde5c199de281390ce7b
Diffstat (limited to 'src/com/android/mail/browse/SwipeableConversationItemView.java')
-rw-r--r-- | src/com/android/mail/browse/SwipeableConversationItemView.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/mail/browse/SwipeableConversationItemView.java b/src/com/android/mail/browse/SwipeableConversationItemView.java index 9db966906..10657f4f1 100644 --- a/src/com/android/mail/browse/SwipeableConversationItemView.java +++ b/src/com/android/mail/browse/SwipeableConversationItemView.java @@ -56,10 +56,9 @@ public class SwipeableConversationItemView extends FrameLayout implements Toggle final ConversationCheckedSet set, final Folder folder, final int checkboxOrSenderImage, boolean swipeEnabled, final boolean importanceMarkersEnabled, final boolean showChevronsEnabled, - final AnimatedAdapter animatedAdapter, final int position) { + final AnimatedAdapter animatedAdapter) { mConversationItemView.bind(conversation, activity, set, folder, checkboxOrSenderImage, - swipeEnabled, importanceMarkersEnabled, showChevronsEnabled, animatedAdapter, - position); + swipeEnabled, importanceMarkersEnabled, showChevronsEnabled, animatedAdapter); } public void startUndoAnimation(AnimatorListener listener, boolean swipe) { |