Пример #1
0
        @Override
        public void onDestroyActionMode(ActionMode mode) {
          Set<Integer> checkedLooks = adapter.getCheckedItems();
          Iterator<Integer> iterator = checkedLooks.iterator();

          while (iterator.hasNext()) {
            int position = iterator.next();
            copyLook(position);
          }
          setSelectMode(ListView.CHOICE_MODE_NONE);
          adapter.clearCheckedItems();

          actionMode = null;
          setActionModeActive(false);

          registerForContextMenu(listView);
          BottomBar.enableButtons(getActivity());
        }
Пример #2
0
  @Override
  public boolean onContextItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case R.id.context_menu_copy:
        {
          copyLook(selectedLookPosition);
          break;
        }

      case R.id.context_menu_cut:
        break;

      case R.id.context_menu_insert_below:
        break;

      case R.id.context_menu_move:
        break;

      case R.id.context_menu_rename:
        {
          showRenameDialog();
          break;
        }

      case R.id.context_menu_delete:
        {
          showDeleteDialog();
          break;
        }
      case R.id.context_edit_in_pocket_paint:
        {
          sendPocketPaintIntent(selectedLookPosition);
          break;
        }
    }
    return super.onContextItemSelected(item);
  }