I'm trying to use the CAB with a ListView:
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
listView.setMultiChoiceModeListener(new ListView.MultiChoiceModeListener() {
@Override
public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
mode.setTitle(getString(R.string.list_selector_num_items_selected, listView.getCheckedItemCount()));
Log.i("LIST",position + " selected");
}
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
return true;
}
... and so on
This creates the CAB with the default ActionBar which is overlaying the Toolbar in combination with this entry in my AppTheme:
<item name="windowActionModeOverlay">true</item>
This is working BUT it look not very nice.
What i would like to achieve is similar to the current Gmail app if you long-press on an email.
Any ideas how to achieve this ?
I'm using the SupportActionBar:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
}