コード例 #1
0
ファイル: MuPDFActivity.java プロジェクト: BrandonGk/Mupdf
 public void OnCancelAcceptButtonClick(View v) {
   MuPDFView pageView = (MuPDFView) mDocView.getDisplayedView();
   if (pageView != null) {
     pageView.deselectText();
     pageView.cancelDraw();
   }
   mDocView.setMode(MuPDFReaderView.Mode.Viewing);
   switch (mAcceptMode) {
     case CopyText:
       mTopBarMode = TopBarMode.More;
       break;
     default:
       mTopBarMode = TopBarMode.Annot;
       break;
   }
   mTopBarSwitcher.setDisplayedChild(mTopBarMode.ordinal());
 }
コード例 #2
0
ファイル: MuPDFActivity.java プロジェクト: BrandonGk/Mupdf
  public void OnAcceptButtonClick(View v) {
    MuPDFView pageView = (MuPDFView) mDocView.getDisplayedView();
    boolean success = false;
    switch (mAcceptMode) {
      case CopyText:
        if (pageView != null) success = pageView.copySelection();
        mTopBarMode = TopBarMode.More;
        showInfo(
            success
                ? getString(R.string.copied_to_clipboard)
                : getString(R.string.no_text_selected));
        break;

      case Highlight:
        if (pageView != null) success = pageView.markupSelection(Annotation.Type.HIGHLIGHT);
        mTopBarMode = TopBarMode.Annot;
        if (!success) showInfo(getString(R.string.no_text_selected));
        break;

      case Underline:
        if (pageView != null) success = pageView.markupSelection(Annotation.Type.UNDERLINE);
        mTopBarMode = TopBarMode.Annot;
        if (!success) showInfo(getString(R.string.no_text_selected));
        break;

      case StrikeOut:
        if (pageView != null) success = pageView.markupSelection(Annotation.Type.STRIKEOUT);
        mTopBarMode = TopBarMode.Annot;
        if (!success) showInfo(getString(R.string.no_text_selected));
        break;

      case Ink:
        if (pageView != null) success = pageView.saveDraw();
        mTopBarMode = TopBarMode.Annot;
        if (!success) showInfo(getString(R.string.nothing_to_save));
        break;
    }
    mTopBarSwitcher.setDisplayedChild(mTopBarMode.ordinal());
    mDocView.setMode(MuPDFReaderView.Mode.Viewing);
  }
コード例 #3
0
ファイル: MuPDFActivity.java プロジェクト: BrandonGk/Mupdf
 public void OnCancelDeleteButtonClick(View v) {
   MuPDFView pageView = (MuPDFView) mDocView.getDisplayedView();
   if (pageView != null) pageView.deselectAnnotation();
   mTopBarMode = TopBarMode.Annot;
   mTopBarSwitcher.setDisplayedChild(mTopBarMode.ordinal());
 }