I am investigating the PDF library PSPDFKit for Android.
// Inside my app's dependencies {}
implementation 'com.pspdfkit:pspdfkit-demo:4.0.2'
The library is impressive and has many valuable features "Out Of The Box". However, I have encountered an issue with the Dialog Fragment that displays when creating Note Annotations.
I need to have a customized dialog UI as the PDFs my application displays allow multiple users to add/edit annotations. This requires the dialog that is displayed when editing annotations to contain the user profile image and full name that created the annotation.
I am using com.pspdfkit.ui.PdfFragment
as a child fragment in my application and cannot see any way that allows me to supply a custom dialogFragment when creating and/or editing Note annotations.
Is it possible to customise the dialog fragment displayed when creating/editing a Note fragment in PSPDFKit?
From what I can see of the source code, it's this method I need to override within PSPDFKit.
public void enterAnnotationCreationMode(@NonNull final AnnotationTool annotationTool) {
this.viewCoordinator.a(new b() {
public void run(@NonNull FrameLayout container, @NonNull PdfPasswordView passwordView, @NonNull View errorView, @NonNull final DocumentView documentView) {
el var10000 = com.pspdfkit.framework.a.d();
PdfFragment.this.getContext();
if(var10000.a(PdfFragment.this.configuration)) {
if(!PdfFragment.this.getAnnotationPreferences().isAnnotationCreatorSet()) {
AnnotationCreatorInputDialogFragment.show(PdfFragment.this.getActivity().getSupportFragmentManager(), (String)null, new OnAnnotationCreatorSetListener() {
public void onAnnotationCreatorSet(String annotationCreator) {
documentView.enterAnnotationCreationMode(annotationTool);
}
public void onAbort() {
}
});
com.pspdfkit.framework.a.f().a("show_annotation_creator_dialog").a();
} else {
documentView.enterAnnotationCreationMode(annotationTool);
}
} else {
throw new PSPDFKitException("Entering annotation creation mode for " + annotationTool + " is not permitted, either by the license or configuration.");
}
}
}, true);
}