@Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { setSelectMode(ListView.CHOICE_MODE_SINGLE); mode.setTitle(getString(R.string.edit_in_pocket_paint)); setActionModeActive(true); return true; }
@Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { setSelectMode(ListView.CHOICE_MODE_MULTIPLE); setActionModeActive(true); actionModeTitle = getString(R.string.delete); singleItemAppendixActionMode = getString(R.string.look); multipleItemAppendixActionMode = getString(R.string.looks); mode.setTitle(actionModeTitle); return true; }
@Override public void onDestroyActionMode(ActionMode mode) { Set<Integer> checkedLooks = adapter.getCheckedItems(); Iterator<Integer> iterator = checkedLooks.iterator(); while (iterator.hasNext()) { int position = iterator.next(); sendPocketPaintIntent(position); } setSelectMode(ListView.CHOICE_MODE_NONE); adapter.clearCheckedItems(); actionMode = null; setActionModeActive(false); registerForContextMenu(listView); BottomBar.enableButtons(getActivity()); }
@Override public void onDestroyActionMode(ActionMode mode) { Set<Integer> checkedLooks = adapter.getCheckedItems(); Iterator<Integer> iterator = checkedLooks.iterator(); if (iterator.hasNext()) { int position = iterator.next(); selectedLookData = (LookData) listView.getItemAtPosition(position); showRenameDialog(); } setSelectMode(ListView.CHOICE_MODE_NONE); adapter.clearCheckedItems(); actionMode = null; setActionModeActive(false); registerForContextMenu(listView); BottomBar.enableButtons(getActivity()); }