1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Fix a crash on swipe in the message list. Thanks to cketti.

Fixes issue 1054
This commit is contained in:
Jesse Vincent 2010-01-20 22:10:10 +00:00
parent 08e570d40f
commit c6058686b3

View File

@ -1348,10 +1348,18 @@ public class MessageList
boolean selected = (deltaX > 0);
int position = mListView.pointToPosition((int)e1.getX(), (int)e1.getY());
((MessageInfoHolder) mAdapter.getItem(position)).selected = selected;
mSelectedCount += (selected ? 1 : -1);
mAdapter.notifyDataSetChanged();
toggleBatchButtons();
if (position != AdapterView.INVALID_POSITION)
{
MessageInfoHolder msgInfoHolder = (MessageInfoHolder) mAdapter.getItem(position);
if (msgInfoHolder != null)
{
msgInfoHolder.selected = selected;
mSelectedCount += (selected ? 1 : -1);
mAdapter.notifyDataSetChanged();
toggleBatchButtons();
}
}
}
return false;