> Autoscroll works but does not load the second page of the pdf it shows blank I want to bind the scrollHandle to the motion and speed of the seekbar which auto scrolls the screen down:
This is a pdf library:
public void Show_Full_Text() {
Title_Text = globalVar.getMain_Title();
this.setTitle(Title_Text);
pdfView.fromAsset("pdf/page_" + page_id + ".pdf")
.onRender(new OnRenderListener()
{
@Override
public void onInitiallyRendered
(int nbPages, float pageWidth, float pageHeight)
{
pdfView.fitToWidth();
}
})
.scrollHandle(new DefaultScrollHandle(this))
.load();
}
This is seekbar code that auto-animates:
seekBar = findViewById(R.id.seekbartt);
pdfView = findViewById(R.id.pdfView1);
int progress = 1;
int currentPage = 0;
scrollSpeed = 0;
final Handler handler = new Handler();
final int delay = 50; //مستوى السرعة تنتهي بهذا الرقم وكلما زاد الرقم قلت السرعة النهائية
final int maxProgress = seekBar.getMax();
final int totalPages = pdfView.getPageCount();
seekBar.setProgress(progress);
final Runnable runnable = new Runnable() {
public void run() {
pdfView.scrollBy(0, scrollSpeed);
handler.postDelayed(this, delay);
}
};
handler.postDelayed(runnable, delay);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
scrollSpeed = progress;
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
handler.postDelayed(runnable, delay);
I got very tired trying that, this method works in webview but in PDFview it doesn't work, I asked the artificial intelligence in every way and I didn't get any result and solution