Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to edit/delete text annotations on page #182

Open
dstillman opened this issue Oct 31, 2024 · 2 comments
Open

Ability to edit/delete text annotations on page #182

dstillman opened this issue Oct 31, 2024 · 2 comments
Labels
P3 Medium

Comments

@dstillman
Copy link
Member

Currently it seems like this is only possible in the sidebar. On iOS, we create a custom toolbar on tap that lets you adjust font size (awkwardly — it should probably be a slider that updates an editable textbox) and color, add tags, and delete the annotation.

@dstillman dstillman added the P3 Medium label Oct 31, 2024
Dima-Android added a commit that referenced this issue Nov 18, 2024
…182.

Fixing color edit and tag edits being ignored for all annotation sometimes on phones.
Refactoring of PdfAnnotation rows.

Upping versionCode to 118
@Dima-Android
Copy link
Collaborator

On iOS editing options for text annotation is implemented in the following way:

  1. First tap on text annotation
  2. Tap on text inside text annotation
  3. Toolbar above keyboard appears where you can select to change font, color and tags.

I don’t think it makes sense Android style-wise to implement it in a similar way, so instead I did it in the way that is most similar to how annotation editing works for other annotations, but with a caveat:

  1. Have text annotation not selected (this is important)
  2. Long press on annotation.
  3. Annotation edit screen opens (that allows to edit font size, color, tags and delete)

Why annotation has to be deselected first and why is it a long press?
That’s because PSPDFKIT only gives us onAnnotationLongPress callback if you long press on a deselected text annotation.
If annotation is already selected (by a usual single quick tap), and you also then long press on it then this callback is never called and long pressing just triggers the annotation’s ‘moving and resizing’ mode. And if you were to just quick tap the selected annotation it will go into text editing mode.

@dstillman
Copy link
Member Author

I think long-press is going to be very hard for people to find. Are we able to show anything after a single press? Even some sort of floating "Edit" button or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Medium
Development

No branches or pull requests

2 participants