In my project I am using PDFViewCtrl view and custom annoations to draw annotations. All the annotations are working fine except the Free Hand Ink tool. When the lines were drawn, they are getting deleted when another annotation tool is selected, ex: choosing stamp tool.
The scenario is:
Free hand tool is selected and few lines are drawn. These are persistent until another tool is selected.
Select another annotation tool and add few annoations. Now the lines added in step 1 is deleted
Now select free hand Ink tool again and add few lines. Now the lines added in step 1 are coming back.
The issue is not happening when using another tool like stamp, highlighter, text.
Below are the steps of screenshots 1, 2, 3 jpgs. (in 3rd screenshot the lines are back)
Thanks for the project. The issue is you are creating all the tools at once, that’s actually not how our tools library is designed. Tools are supposed to be created on the go so it can have its own lifecycle, so upon start/finish of a tool, certain methods are called. There should only ever be 1 created tool at a time.
See updated source (I commented out everything but 2 tools to demonstrate): MainActivity.kt (6.9 KB)