Ejemplo n.º 1
0
        @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;
        }
Ejemplo n.º 2
0
        @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;
        }
Ejemplo n.º 3
0
        @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());
        }
Ejemplo n.º 4
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());
        }