Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

Double Tap - single tap event still fires? 10 years 8 months ago #3320

  • adpward
  • adpward's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
Hi,

I seem to have a bit of an issue with OnPDFDoubleTapped and OnPDFSingleTapped.

If I single tap, only OnPDFSingleTapped is invoked.

If I double tap, OnPDFSingleTapped is invoked followed by OnPDFDoubleTapped.

When I double tap, I only want OnPDFDoubleTapped to be invoked - can you please advice a way around this?

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

Double Tap - single tap event still fires? 10 years 8 months ago #3321

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
yes, gesture always fire single tap first.

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

Double Tap - single tap event still fires? 10 years 8 months ago #3324

  • adpward
  • adpward's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
Ok edited my response with more detail.

It's obvious that I use return True / False to get rid of the single press event.

My issue is this : -

My customer wants to single press to show / hide the buttons such that more of the view is available. So I've added some code to facilitate this.

I have added an event to the interface - OnDocumentClicked and fire it via m_listener.OnDocumentClicked().

What test can I perform in the single press event to prevent it from calling this method, because a double press is following?

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

Last edit: by Peessewhogs.

Double Tap - single tap event still fires? 10 years 8 months ago #3334

  • adpward
  • adpward's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
I have fixed this by adding a handler to the PDFReader class.

I invoke the handler with a postDelayed, using a 100ms delay, upon the OnPDFSingleTapped event firing. When the OnPDFDoubleTapped event fires, if a handler exists, it stops it using removeCallbacks.

Job done, looks great and is nice and responsive.

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

Double Tap - single tap event still fires? 9 years 6 months ago #7291

  • Semenovich
  • Semenovich's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 13
  • Thank you received: 0
Can you tell me the exact max delay between two taps that invokes OnPDFDoubleTapped? I need it to set the correct delay for handler.postDelayed() method.

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

  • Page:
  • 1
Powered by Kunena Forum