1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-15 22:15:15 -05:00

Get rid of incomplete code to toggle a message's selection state

This commit is contained in:
cketti 2012-09-13 06:45:55 +02:00
parent 997943a521
commit 5a29c8a415

View File

@ -1081,7 +1081,7 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
return true; return true;
} }
case KeyEvent.KEYCODE_S: { case KeyEvent.KEYCODE_S: {
setSelected(selection, !message.selected); toggleMessageSelect(message);
return true; return true;
} }
case KeyEvent.KEYCODE_D: { case KeyEvent.KEYCODE_D: {
@ -2487,18 +2487,6 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
} }
} }
private void setSelected(final List<MessageInfoHolder> holders, final boolean newState) {
for (final MessageInfoHolder holder : holders) {
if (holder.selected != newState) {
holder.selected = newState;
mSelectedCount += (newState ? 1 : -1);
}
}
mAdapter.notifyDataSetChanged();
updateActionModeTitle();
computeSelectAllVisibility();
}
private void toggleMessageSelect(final MessageInfoHolder holder){ private void toggleMessageSelect(final MessageInfoHolder holder){
if (mActionMode != null) { if (mActionMode != null) {
if (mSelectedCount == 1 && holder.selected) { if (mSelectedCount == 1 && holder.selected) {