PDFViewAct.java OnPDFDoubleTapped(float x, float y) doesn't work right - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: PDFViewAct.java OnPDFDoubleTapped(float x, float y) doesn't work right

PDFViewAct.java OnPDFDoubleTapped(float x, float y) doesn't work right 1 week 4 days ago #14713

  • ericatudn
  • ericatudn's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
I am using Android version 3.52.6 sample project,
The method OnPDFDoubleTapped(float x, float y) of PDFViewAct.java dosen't work well, the zooming changed wrong.
Please help.
Thank you very much.

Please Log in or Create an account to join the conversation.

PDFViewAct.java OnPDFDoubleTapped(float x, float y) doesn't work right 1 week 4 days ago #14715

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 896
  • Karma: 23
  • Thank you received: 78
We have checked and the zoom is working correctly.

Can you be more specific please, what do you mean by changing wrong?

Please Log in or Create an account to join the conversation.

PDFViewAct.java OnPDFDoubleTapped(float x, float y) doesn't work right 1 week 4 days ago #14717

  • ericatudn
  • ericatudn's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
I think I know what's went wrong in my case, now.
It's because the screen was not refreshed after double tapped.
So I make it happen by add m_view.invalidate() as following:

@Override
public boolean OnPDFDoubleTapped(float x, float y)
{
float mCurZoomLevel = m_view.PDFGetZoom();

if (m_view.PDFGetScale() <= m_view.PDFGetMinScale())
Global.zoomStep = 1;
if ((mCurZoomLevel > Global.zoomLevel && Global.zoomStep > 0) ||
(mCurZoomLevel == 1 && Global.zoomStep < 0)) //reverse zoom step
Global.zoomStep *= -1;

m_view.PDFSetZoom((int) x, (int) y, m_view.PDFGetPos((int) x, (int) y), mCurZoomLevel + Global.zoomStep);
RadaeePluginCallback.getInstance().onDoubleTapped(m_view.PDFGetCurrPage(), x, y);

m_view.invalidate(); // Add this to refresh.

return true;
}

And now the zooming works fine.
So this is my explanation of my problem: "The screen was not refreshed after double tapped"
Dose this help you for understanding my case?
Do you have better solution then what I did (adding m_view.invalidate())?
English is not my native language and I have done my best, hope you can understand what I have tried to say.
Anyway, I solved this problem with my way, unless you have any opinion about this.
Thanks.

Please Log in or Create an account to join the conversation.

PDFViewAct.java OnPDFDoubleTapped(float x, float y) doesn't work right 1 week 3 days ago #14724

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 896
  • Karma: 23
  • Thank you received: 78
Thanks for the feedback.

We still cannot replicate it in the demo project, but glad that you found a solution.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum