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 7 years 8 months ago #10933

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

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.

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

Enabling listener for Edit box Annotation 7 years 8 months ago #10936

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

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)

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

Enabling listener for Edit box Annotation 7 years 8 months ago #10937

  • sbettal
  • sbettal's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
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.

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

Enabling listener for Edit box Annotation 7 years 8 months ago #10938

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
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.

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

Enabling listener for Edit box Annotation 7 years 8 months ago #10939

  • sbettal
  • sbettal's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
I implemented editable functionality on long tab. But getting false results. Its misplacing the edit box on page. Is there any other solution for this.

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

Enabling listener for Edit box Annotation 7 years 8 months ago #10940

  • sbettal
  • sbettal's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 0
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.

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum