Beispiel #1
0
  public void onMove() {
    if ((!mController.isMoveCapable(mAccount)) || (mMessage == null)) {
      return;
    }
    if (!mController.isMoveCapable(mMessage)) {
      Toast toast =
          Toast.makeText(
              getActivity(), R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
      toast.show();
      return;
    }

    startRefileActivity(ACTIVITY_CHOOSE_FOLDER_MOVE);
  }
Beispiel #2
0
  private void configureMenu(Menu menu) {
    // first run displayMessage() gets called before onCreateOptionMenu()
    if (menu == null) {
      return;
    }

    // enable them all
    menu.findItem(R.id.copy).setVisible(true);
    menu.findItem(R.id.move).setVisible(true);
    menu.findItem(R.id.archive).setVisible(true);
    menu.findItem(R.id.spam).setVisible(true);

    mToggleMessageViewMenu = menu.findItem(R.id.toggle_message_view_theme);
    if (K9.getK9MessageViewTheme() == K9.THEME_DARK) {
      mToggleMessageViewMenu.setTitle(R.string.message_view_theme_action_light);
    } else {
      mToggleMessageViewMenu.setTitle(R.string.message_view_theme_action_dark);
    }

    toggleActionsState(menu, true);

    updateUnreadToggleTitle();

    // comply with the setting
    if (!mAccount.getEnableMoveButtons()) {
      menu.findItem(R.id.move).setVisible(false);
      menu.findItem(R.id.archive).setVisible(false);
      menu.findItem(R.id.spam).setVisible(false);
    } else {
      // check message, folder capability
      if (!mController.isCopyCapable(mAccount)) {
        menu.findItem(R.id.copy).setVisible(false);
      }

      if (mController.isMoveCapable(mAccount)) {
        menu.findItem(R.id.move).setVisible(true);

        menu.findItem(R.id.archive)
            .setVisible(
                !mMessageReference.folderName.equals(mAccount.getArchiveFolderName())
                    && mAccount.hasArchiveFolder());

        menu.findItem(R.id.spam)
            .setVisible(
                !mMessageReference.folderName.equals(mAccount.getSpamFolderName())
                    && mAccount.hasSpamFolder());
      } else {
        menu.findItem(R.id.copy).setVisible(false);
        menu.findItem(R.id.move).setVisible(false);
        menu.findItem(R.id.archive).setVisible(false);
        menu.findItem(R.id.spam).setVisible(false);
      }
    }
  }
Beispiel #3
0
  public void onRefile(String dstFolder) {
    if (!mController.isMoveCapable(mAccount)) {
      return;
    }
    if (!mController.isMoveCapable(mMessage)) {
      Toast toast =
          Toast.makeText(
              getActivity(), R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG);
      toast.show();
      return;
    }

    if (K9.FOLDER_NONE.equalsIgnoreCase(dstFolder)) {
      return;
    }

    if (mAccount.getSpamFolderName().equals(dstFolder) && K9.confirmSpam()) {
      mDstFolder = dstFolder;
      showDialog(R.id.dialog_confirm_spam);
    } else {
      refileMessage(dstFolder);
    }
  }