Hello,
I have managed to detect the flinging to a page by modifying PDFView.java motionNormal method to store the current page on MotionEvent.ACTION_DOWN and then compare it to the page after MotionEvent.ACTION_UP.
I am able to perform scale and center but it still glitches sometimes by moving to a different page(often the last page). When I comment out the scale, it stops glitching. I think vSetScale is sometimes done after the center page.
//inside MotionEvent.ACTION_UP of motionNormal method..
final PDFPos pdfPos = vGetPos(m_w / 2, m_h / 2);
if(holdPos != null && pdfPos != null && holdPos.pageno != pdfPos.pageno) {
m_view.vSetScale(m_view.vGetMinScale(), 0, 0);
m_view.vCenterPage(pdfPos.pageno);
holdPos = null;
}
My question is, how do I make it so that the code only does vSetScale AFTER vCenterPage?
Thanks,
Rocky