I want to enable drag-n-drop functionality, as well as to editable functionality on editbox annotation. But i am unable to get event when user clicks on edit text. Always getting onPDFSingleTaped. Please suggest me how to i acheive this functionality. And i want to increase the edit box height dynamically when text is wrapped into edit box.
For the drag/drop functionality, it's already implemented in the demo project .. please check PDFLayoutView.onTouchAnnot (needs a professional or premium license).
For the listener to editbox annotation, it's implemented in the demo project in PDFLayoutView.onSingleTapConfirmed that calls PDFLayoutView.onEditAnnot (premium license).
To increase the editbox height, you can add a listener to check the entered text length and adapte the editbox accordingly, using Annotation.SetRect.
But as a warning it will not be optimal (performance wise)..as a modification on the annotation level, requires a re-render. (so try to do the re-render once after the user has finished entering the text)
I used above methods, but my problem is when user single taps on editbox annotation, it will open editable view with keyboard every time. So when do drag and drop functionality will work on editbox annoataion? since here condition check made as m_annot.GetEditType() >0 so that it will always made edit box as editable. So my questions is to when to enable drag-n-drop functionality on editbox.
For editable annotations, the drag & drop will not work immediately as the edit behavior takes the priority..the demo project has the scope to show you how to implement some of the functionality ..so not all the features are fully implemented.
As a suggestion, you need to separate the events, may be a single tab to edit and a long tab to activate drag & drop.
I have enabled drag-n-drop functionality for long tap. When i debug the code, every time event.getActionMasked() is returns 1 ie MotionEvent ACTION_UP. For this switch case break is not defined so its continuing execution to MotionEvent.CANCEL also. In this case, m_annot_rect0 is getting null. so editbox is still on the place. So please suggest me proper solution to enable it.