mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 13:12:25 -05:00
Fix a crash on swipe in the message list. Thanks to cketti.
Fixes issue 1054
This commit is contained in:
parent
08e570d40f
commit
c6058686b3
@ -1348,10 +1348,18 @@ public class MessageList
|
|||||||
boolean selected = (deltaX > 0);
|
boolean selected = (deltaX > 0);
|
||||||
int position = mListView.pointToPosition((int)e1.getX(), (int)e1.getY());
|
int position = mListView.pointToPosition((int)e1.getX(), (int)e1.getY());
|
||||||
|
|
||||||
((MessageInfoHolder) mAdapter.getItem(position)).selected = selected;
|
if (position != AdapterView.INVALID_POSITION)
|
||||||
mSelectedCount += (selected ? 1 : -1);
|
{
|
||||||
mAdapter.notifyDataSetChanged();
|
MessageInfoHolder msgInfoHolder = (MessageInfoHolder) mAdapter.getItem(position);
|
||||||
toggleBatchButtons();
|
|
||||||
|
if (msgInfoHolder != null)
|
||||||
|
{
|
||||||
|
msgInfoHolder.selected = selected;
|
||||||
|
mSelectedCount += (selected ? 1 : -1);
|
||||||
|
mAdapter.notifyDataSetChanged();
|
||||||
|
toggleBatchButtons();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user