@SuppressLint("NewApi") @Override public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) { mWrapped.onItemCheckedStateChanged(mode, position, id, checked); if (getCheckedItemCount() == 0) { mode.finish(); } }
@Override public void onDestroyActionMode(ActionMode mode) { mWrapped.onDestroyActionMode(mode); mChoiceActionMode = null; clearChoices(); updateOnScreenCheckedViews(); setLongClickable(true); }
@Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { if (mWrapped.onCreateActionMode(mode, menu)) { setLongClickable(false); return true; } return false; }
/** * Called when the ActionMode is about to be exited and destroyed. * * @param mode The current ActionMode being destroyed. */ public void onDestroyActionMode(ActionMode mode) { listener.onDestroyActionMode(mode); actionmode = null; ABSListView.this.clearChoices(); ABSListView.this.requestLayout(); }
/** * Called to report a user click on an action button. * * @param mode The current ActionMode. * @param item The item that was clicked. * @return Whether the callback handled the event. */ public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return listener.onActionItemClicked(mode, item); }
/** * Called to refresh an action mode's action menu whenever it is invalidated. * * @param mode The current ActionMode. * @param menu The menu to be refreshed. * @return Whether the menu has been changed. */ public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return listener.onPrepareActionMode(mode, menu); }
/** * This method will be called whenever an item has been checked or unchecked. This will inform * the listener and finish the ActionMode, if the last item has been unchecked. * * @param mode The ActionMode providing the selection mode. * @param position Adapter position of the item that was checked or unchecked. * @param id Adapter ID of the item that was checked or unchecked. * @param checked Whether the item is now checked. */ public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) { listener.onItemCheckedStateChanged(mode, position, id, checked); if (ABSListView.this.getCheckedItemCount() == 0) { mode.finish(); } }
@Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return mWrapped.onPrepareActionMode(mode, menu); }
@Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return mWrapped.onActionItemClicked(mode, item); }