Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Double Tap - single tap event still fires?

More
IP: 192.168.0.70 12 years 8 months ago #3320 by adpward
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?
More
IP: 192.168.0.70 12 years 8 months ago #3321 by radaee
yes, gesture always fire single tap first.
More
IP: 192.168.0.70 12 years 8 months ago - 12 years 8 months ago #3324 by adpward
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: 12 years 8 months ago by Peessewhogs.
More
IP: 192.168.0.70 12 years 8 months ago #3334 by adpward
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.
More
IP: 192.168.0.71 11 years 6 months ago #7291 by Semenovich
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.
Time to create page: 0.413 seconds
Powered by Kunena Forum