示例#1
0
        @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());
        }
示例#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);
  }