Skip to content

fix: dispatch event PdfView.java #926

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions android/src/main/java/org/wonday/pdf/PdfView.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

import android.content.ContentResolver;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.SizeF;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -105,7 +107,7 @@ public void onPageChanged(int page, int numberOfPages) {
TopChangeEvent tce = new TopChangeEvent(surfaceId, getId(), event);

if (dispatcher != null) {
dispatcher.dispatchEvent(tce);
new Handler(Looper.getMainLooper()).postDelayed(() -> dispatcher.dispatchEvent(tce), 10);
}

// ReactContext reactContext = (ReactContext)this.getContext();
Expand Down Expand Up @@ -502,4 +504,4 @@ public boolean onTouch(View v, MotionEvent event) {
}
}
}
}
}