WhisperSystems/TextSecure — pull request #1601 by phenx-de (2014-06-13 11:03:14+00:00)
Title: Add batch mode to contextual action bar

Follow-up to #1008. CAB = Contextual Action Bar.

The implementation works only on API 11+, so I left the "old" CAB for API 9-10.

If only one item is selected, the new CAB works exactly as the old one did. As soon as a second item is tapped, all menu items but delete get removed/hidden and the title is set to "batch mode" with a subtitle telling how many items are currently selected. The delete action works exactly like the deletion of conversations in the ConversationListFragment, which means it uses an AsyncTask. In fact, I took the code for most of the multiple-delete method from there, so credits to whoever implemented this ;-)

When the selected items are reduced to one, the classic CAB is shown again.

![cab](https://cloud.githubusercontent.com/assets/1475672/3269273/46bf54e2-f2ea-11e3-83d8-0867ad5cd3c5.png)