Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Comments

feature/improvements#1

Open
amirk3321 wants to merge 4 commits intoapolloai:masterfrom
amirk3321:feature/improvements
Open

feature/improvements#1
amirk3321 wants to merge 4 commits intoapolloai:masterfrom
amirk3321:feature/improvements

Conversation

@amirk3321
Copy link

Details

This branch introduces many features as per requirements and fixes few warnings from old deprecated APIs. Below listed features are introduced corresponding to platforms.

Feature (1)

Previously, when we were adding annotations PSPDFKit library over a pdf document, it prompt us to enter author name on every new document. A boolean field askForAnnotationUsername introduced to either we want this functionality or not. In addition to the same issue, a new field defaultAuthorName is introduced to add a default author name.

Code example:

  configuration: PdfConfiguration(
    askForAnnotationUsername: false // toggle
    defaultAuthorName: "John Doe" // won't be assigned if we ignore it.
  )
)

Test result flutter: Android [ ✅ ] & iOS [ ✅ ]

Feature (2)

Previously, when enableAnnotationEditing was false, it was correctly preventing annotations for being editing but from a tabview where we navigate from an outline button had a list of annotations of all the pdf pages, there, on iOS we were still able to swipe-to-delete annotations but the annotations were not actually deleted but the behaviour were existed which was causing confusion. And on Android, tapping or editing an disabled annotation from the annotation list leading to app crash.

Now, a new boolean field allowAnnotationDeletion is introduced which work along with enableAnnotationEditing to fix the above issues.

on iOS: when above mentioned both fields are false, annotation editing is disabled and we cannot anymore interact with the annotation list since the editing was disabled in this PR.
on Android: when above mentioned both fields are false, annotation editing is disabled and the annotation list is removed from tabview.

Reason of removing the annotation list tab: When editing was false, interacting with annotations from the list was leading to an app crash on Android, saying com.pspdfkit.exceptions.PSPDFKitException: Entering annotation editing mode for [] is not permitted, either by the license or configuration and since we're not exposed to edit the UI code to manually disable the behaviour of the annotation list on android side and just doing .disableAnnotationList() which is the only callback they provide which I did leads to remove the complete tab from the tabview preventing crash.

Test result flutter: Android [ ✅ ] & iOS [ ✅ ]

Feature (3)

Previously, when I tried to add annotation configuration using .setAnnotationConfiguration method from PspdfkitWidgetController it was throwing Missing Plugin Implementation for a method. It was the problem with, we were invoking a method with name annotationConfiguration but on platform specific side the code was accessing the method as annotationPresentConfiguration. Syncing the names make it work. Now, we're able to add default config for pdf document including default thickness, colour and more.

Test result flutter: Android [ ✅ ] & iOS [ ✅ ]

Feature (4)

Previously, I figured out, onAnnotationsChanged callback was only working on iOS and wasn't implemented on Android. I added callbacks to Android side and now callbacks are send to onAnnotationsChanged even on Android.

Test result flutter: Android [ ✅ ] & iOS [ ✅ ]

Moreover, on Android, there were few warnings to missing @Deprecated decoration over some deprecated methods and properties. I added this and now we're no more receiving these warnings on Android.

Acceptance Criteria

  • [ ✅ ] Before merging retest all the examples to make sure that they work on both Android and iOS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants