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

TOPIC:

Enabling listener for Edit box Annotation 9 years 1 month ago #10942

  • sbettal
  • sbettal's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
Hi

Please provide any solution for this. I am stuck here.

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

Enabling listener for Edit box Annotation 9 years 1 month ago #10943

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
Dear Sbettal,

How exactly did you implement it?

It should be something like:
public void onLongPress(MotionEvent e)
        {
			if( m_status == STA_NONE || m_status == STA_ANNOT ) {
				m_annot_pos = m_layout.vGetPos((int) e.getX(), (int) e.getY());
				m_annot_page = m_layout.vGetPage(m_annot_pos.pageno);
				Page page = m_doc.GetPage(m_annot_page.GetPageNo());
				if (page == null) m_annot = null;
				else m_annot = page.GetAnnotFromPoint(m_annot_pos.x, m_annot_pos.y);
				if (m_annot == null) {
					m_annot_page = null;
					m_annot_pos = null;
					m_annot_rect = null;
					if (m_listener != null) {
						if (m_status == STA_ANNOT)
							m_listener.OnPDFAnnotTapped(m_annot_page, null);
						else
							m_listener.OnPDFBlankTapped();
					}
					m_status = STA_NONE;
				} else {
					page.ObjsStart();
					m_annot_rect = m_annot.GetRect();
					float tmp = m_annot_rect[1];
					m_annot_rect[0] = m_annot_page.GetVX(m_annot_rect[0]) - m_layout.vGetX();
					m_annot_rect[1] = m_annot_page.GetVY(m_annot_rect[3]) - m_layout.vGetY();
					m_annot_rect[2] = m_annot_page.GetVX(m_annot_rect[2]) - m_layout.vGetX();
					m_annot_rect[3] = m_annot_page.GetVY(tmp) - m_layout.vGetY();
					m_status = STA_ANNOT;
					onTouchAnnot(e);
				}
			}
        }

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum