Android Open Source - RadaeePDF-B4A R S Reader View






From Project

Back to project page RadaeePDF-B4A.

License

The source code is released under:

Apache License

If you think the Android project RadaeePDF-B4A listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.rootsoft.rspdfviewer.pdf;
/*ww w . j a v a 2s. c o m*/

import android.graphics.Canvas;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.objects.ViewWrapper;

import com.radaee.pdf.Document;
import com.radaee.reader.ReaderController;
import com.radaee.view.PDFVPage;
import com.radaee.view.PDFView;
import com.radaee.view.PDFView.PDFPos;
import com.radaee.view.PDFView.PDFViewListener;

@ShortName("PDFReaderView")
@ActivityObject
public class RSReaderView extends ViewWrapper<ReaderController>{

  
  //Attributes
  private BA ba;
  private String eventName;
  
  //Constructors

  /**
   * Initializes the PDFView class.
   */
  public void Initialize(final BA ba, String EventName) {
    this.ba = ba;
    this.eventName = EventName.toLowerCase(BA.cul);
    setObject(new ReaderController(ba.activity, ba, EventName.toLowerCase(BA.cul)));
  }
  
  public void Initialize2(final BA ba, String EventName, PDFView view) {
    this.ba = ba;
    this.eventName = EventName.toLowerCase(BA.cul);
    setObject(new ReaderController(ba.activity, view, ba, EventName.toLowerCase(BA.cul)));
  }
  
  //Methods
  
  public void Open(Document doc) {
    getObject().open(doc, pdfViewListener);
  }
    
    
    public PDFView getPDFView() {
      return getObject().getPDFView();
    }
    
    public void Invalidate4() {
      getObject().invalidate4();
    }
    

    
    //Callbacks
    PDFViewListener pdfViewListener = new PDFViewListener() {

      @Override
      public boolean OnPDFDoubleTapped(float x, float y) {
        boolean yesno = false;
        if (ba.subExists(eventName + "_pdfdoubletapped")==true) {
          (yesno) = (Boolean) ba.raiseEvent(this, eventName + "_pdfdoubletapped", new Object[] { x, y } );
        }
        return yesno;
      }

      @Override
      public void OnPDFFound(boolean found) {
        if (ba.subExists(eventName + "_pdffound")==true) {
          ba.raiseEvent(this, eventName + "_pdffound", new Object[] { found } );
        }
        
      }

      @Override
      public void OnPDFInvalidate(boolean post) {
        if (ba.subExists(eventName + "_pdfinvalidate")==true) {
          ba.raiseEvent(this, eventName + "_pdfinvalidate", new Object[] { post } );
        }
        
      }

      @Override
      public void OnPDFLongPressed(float x, float y) {
        if (ba.subExists(eventName + "_pdflongpressed")==true) {
          ba.raiseEvent(this, eventName + "_pdflongpressed", new Object[] { x, y } );
        }
        
      }

      @Override
      public void OnPDFPageDisplayed(Canvas canvas, PDFVPage page) {
        if (ba.subExists(eventName + "_pdfpagedisplayed")==true) {
          ba.raiseEvent(this, eventName + "_pdfpagedisplayed", new Object[] { canvas, page } );
        }
        
      }

      @Override
      public void OnPDFPosChanged(PDFPos pos) {
        if (ba.subExists(eventName + "_pdfposchanged")==true) {
          ba.raiseEvent(this, eventName + "_pdfposchanged", new Object[] { pos } );
        }
        
      }

      @Override
      public void OnPDFSelectEnd() {
        if (ba.subExists(eventName + "_pdfselectend")==true) {
          ba.raiseEvent(this, eventName + "_pdfselectend" );
        }
        
      }

      @Override
      public void OnPDFSelecting(Canvas canvas, int[] arg1, int[] arg2) {
        if (ba.subExists(eventName + "_pdfselecting")==true) {
          ba.raiseEvent(this, eventName + "_pdfselecting", new Object[] { canvas, arg1, arg2 } );
        }
      }

      @Override
      public void OnPDFShowPressed(float x, float y) {
        if (ba.subExists(eventName + "_pdfshowpressed")==true) {
          ba.raiseEvent(this, eventName + "_pdfshowpressed", new Object[] { x, y } );
        }
        
      }

      @Override
      public boolean OnPDFSingleTapped(float x, float y) {
        boolean yesno = false;
        if (ba.subExists(eventName + "_pdfsingletapped")==true) {
          (yesno) = (Boolean) ba.raiseEvent(this, eventName + "_pdfsingletapped", new Object[] { x, y } );
        }
        return yesno;
      }
      
    };

  


}




Java Source Code List

com.example.pdfhttpdemo.MainActivity.java
com.example.pdfhttpdemo.ReaderController.java
com.radaee.pdf.BMDatabase.java
com.radaee.pdf.BMDatabase.java
com.radaee.pdf.BMDatabase.java
com.radaee.pdf.Document.java
com.radaee.pdf.Document.java
com.radaee.pdf.Document.java
com.radaee.pdf.Global.java
com.radaee.pdf.Global.java
com.radaee.pdf.Global.java
com.radaee.pdf.HWriting.java
com.radaee.pdf.HWriting.java
com.radaee.pdf.HWriting.java
com.radaee.pdf.Ink.java
com.radaee.pdf.Ink.java
com.radaee.pdf.Ink.java
com.radaee.pdf.Matrix.java
com.radaee.pdf.Matrix.java
com.radaee.pdf.Matrix.java
com.radaee.pdf.PDFHttpStream.java
com.radaee.pdf.PageContent.java
com.radaee.pdf.PageContent.java
com.radaee.pdf.PageContent.java
com.radaee.pdf.Page.java
com.radaee.pdf.Page.java
com.radaee.pdf.Page.java
com.radaee.pdf.Path.java
com.radaee.pdf.Path.java
com.radaee.pdf.Path.java
com.radaee.reader.PDFCropAct.java
com.radaee.reader.PDFCrop.java
com.radaee.reader.PDFEncAct.java
com.radaee.reader.PDFInkAct.java
com.radaee.reader.PDFInk.java
com.radaee.reader.PDFReaderAct.java
com.radaee.reader.PDFReaderOldAct.java
com.radaee.reader.PDFReaderOld.java
com.radaee.reader.PDFReader.java
com.radaee.reader.PDFSimpleAct.java
com.radaee.reader.PDFSimple.java
com.radaee.reader.PDFTestAct.java
com.radaee.reader.ReaderActivity.java
com.radaee.reader.ReaderController.java
com.radaee.reader.ReaderController.java
com.radaee.util.ComboListAdt.java
com.radaee.util.ComboList.java
com.radaee.util.PDFAESEnc.java
com.radaee.util.PDFAESEnc.java
com.radaee.util.PDFAESStream.java
com.radaee.util.PDFAESStream.java
com.radaee.util.PDFAssetStream.java
com.radaee.util.PDFAssetStream.java
com.radaee.util.PDFFileStream.java
com.radaee.util.PDFFileStream.java
com.radaee.util.PDFGridAdt.java
com.radaee.util.PDFGridItem.java
com.radaee.util.PDFGridThread.java
com.radaee.util.PDFGridView.java
com.radaee.util.PDFHttpStream.java
com.radaee.util.PDFHttpStream.java
com.radaee.util.PDFMemStream.java
com.radaee.util.PDFMemStream.java
com.radaee.util.PDFThumbView.java
com.radaee.util.SnatchAdt.java
com.radaee.util.SnatchView.java
com.rootsoft.pdfviewer.main.java
com.rootsoft.pdfviewer.readercontroller.java
com.rootsoft.rspdfviewer.pdf.RSPDFAnnotation.java
com.rootsoft.rspdfviewer.pdf.RSPDFBMDatabase.java
com.rootsoft.rspdfviewer.pdf.RSPDFDocument.java
com.rootsoft.rspdfviewer.pdf.RSPDFGlobal.java
com.rootsoft.rspdfviewer.pdf.RSPDFHWriting.java
com.rootsoft.rspdfviewer.pdf.RSPDFInk.java
com.rootsoft.rspdfviewer.pdf.RSPDFMatrix.java
com.rootsoft.rspdfviewer.pdf.RSPDFPageContent.java
com.rootsoft.rspdfviewer.pdf.RSPDFPage.java
com.rootsoft.rspdfviewer.pdf.RSPDFPath.java
com.rootsoft.rspdfviewer.pdf.RSPDFTemplate.java
com.rootsoft.rspdfviewer.pdf.RSPDFVPage.java
com.rootsoft.rspdfviewer.pdf.RSPDFViewCurl.java
com.rootsoft.rspdfviewer.pdf.RSPDFViewDual.java
com.rootsoft.rspdfviewer.pdf.RSPDFViewHorz.java
com.rootsoft.rspdfviewer.pdf.RSPDFViewThumb.java
com.rootsoft.rspdfviewer.pdf.RSPDFViewVert.java
com.rootsoft.rspdfviewer.pdf.RSPDFView.java
com.rootsoft.rspdfviewer.pdf.RSReaderView.java