RadaeePDF.com :: Topic: Double Tap - single tap event still fires? (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: Double Tap - single tap event still fires?

Double Tap - single tap event still fires? 4 years 2 months ago #3320

  • adpward
  • adpward's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 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?
The administrator has disabled public write access.

Double Tap - single tap event still fires? 4 years 2 months ago #3321

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
yes, gesture always fire single tap first.
The administrator has disabled public write access.

Double Tap - single tap event still fires? 4 years 2 months ago #3324

  • adpward
  • adpward's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 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?
Last Edit: 4 years 2 months ago by Peessewhogs.
The administrator has disabled public write access.

Double Tap - single tap event still fires? 4 years 2 months ago #3334

  • adpward
  • adpward's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 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.
The administrator has disabled public write access.

Double Tap - single tap event still fires? 2 years 11 months ago #7291

  • Semenovich
  • Semenovich's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Karma: 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.
The administrator has disabled public write access.
Powered by Kunena Forum