I am trying to use 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 a CAB with an ActionBar by default, which overlays the toolbar in combination with this entry in my AppTheme:
<item name="windowActionModeOverlay">true</item>
It works, but it doesnβt look very good.
What I would like to achieve is similar to the current Gmail application if you click on an email address for a long time.
Any ideas how to achieve this?
I am using SupportActionBar:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); if (toolbar != null) { setSupportActionBar(toolbar); }
source share