Пример #1
0
 @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();
   }
 }
Пример #2
0
 @Override
 public void onDestroyActionMode(ActionMode mode) {
   mWrapped.onDestroyActionMode(mode);
   mChoiceActionMode = null;
   clearChoices();
   updateOnScreenCheckedViews();
   setLongClickable(true);
 }
Пример #3
0
 @Override
 public boolean onCreateActionMode(ActionMode mode, Menu menu) {
   if (mWrapped.onCreateActionMode(mode, menu)) {
     setLongClickable(false);
     return true;
   }
   return false;
 }
Пример #4
0
 /**
  * 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();
 }
Пример #5
0
 /**
  * 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);
 }
Пример #6
0
 /**
  * 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);
 }
Пример #7
0
 /**
  * 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();
   }
 }
Пример #8
0
 @Override
 public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
   return mWrapped.onPrepareActionMode(mode, menu);
 }
Пример #9
0
 @Override
 public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
   return mWrapped.onActionItemClicked(mode, item);
 }