Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

Select and unselect of annotation 5 years 4 months ago #14239

  • rishikesh@appristine.in
  • rishikesh@appristine.in's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 24
  • Thank you received: 0
Hello team,
Now scenario is we have to select annotation first and then we use it and if we want to select another annotation we have to unselect it first .
Now I wanted to make it dynamic, ie. directly can select any annotation even i selected any annotation .
Please help me it is very important for me.
Early feedback is appreciated.

Please Log in or Create an account to join the conversation.

Select and unselect of annotation 5 years 4 months ago #14241

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,
you could try to edit the onTouchAnnot method in PDFLayoutView class by adding the two lines at the bottom (with the "// ADD THIS LINE" comment):
private boolean onTouchAnnot(MotionEvent event) {
        if (m_status != STA_ANNOT) return false;
        switch (event.getActionMasked()) {
            case MotionEvent.ACTION_DOWN:
                m_annot_x0 = event.getX();
                m_annot_y0 = event.getY();
                if (m_annot_x0 > m_annot_rect[0] && m_annot_y0 > m_annot_rect[1] &&
                        m_annot_x0 < m_annot_rect[2] && m_annot_y0 < m_annot_rect[3]) {
                    m_annot_rect0 = new float[4];
                    m_annot_rect0[0] = m_annot_rect[0];
                    m_annot_rect0[1] = m_annot_rect[1];
                    m_annot_rect0[2] = m_annot_rect[2];
                    m_annot_rect0[3] = m_annot_rect[3];
                } else {
                    m_annot_rect0 = null;
                    PDFCancelAnnot();  // ADD THIS LINE
                    onTouchNone(event); // ADD THIS LINE
                }
                break;
. //other code
. //other code
. //other code
.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum