Skip to content

Commit

Permalink
Use onPageClick instead of onPrepareAnnotationSelection for emitting …
Browse files Browse the repository at this point in the history
…annotation tapped events (#385)
  • Loading branch information
Reinhard Hafenscher authored Jan 11, 2021
1 parent 6c1fb4e commit 0355c8e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ public void onDocumentSaveCancelled(PdfDocument pdfDocument) {
}

@Override
public boolean onPageClick(@NonNull PdfDocument pdfDocument, int i, @Nullable MotionEvent motionEvent, @Nullable PointF pointF, @Nullable Annotation annotation) {
public boolean onPageClick(@NonNull PdfDocument pdfDocument, int pageIndex, @Nullable MotionEvent motionEvent, @Nullable PointF pointF, @Nullable Annotation annotation) {
if (annotation != null) {
eventDispatcher.dispatchEvent(new PdfViewAnnotationTappedEvent(parent.getId(), annotation));
}
return false;
}

Expand All @@ -116,7 +119,6 @@ public void onPageUpdated(@NonNull PdfDocument pdfDocument, int i) {

@Override
public boolean onPrepareAnnotationSelection(@NonNull AnnotationSelectionController annotationSelectionController, @NonNull Annotation annotation, boolean annotationCreated) {
eventDispatcher.dispatchEvent(new PdfViewAnnotationTappedEvent(parent.getId(), annotation));
return !disableDefaultActionForTappedAnnotations;
}

Expand Down

0 comments on commit 0355c8e

Please sign in to comment.