B4i Library GestureRecognizer - Native UIGestureRecognizer

kc1

Member
Licensed User
Narek,

Thank you for the example! I'll give it a try later.

In the mean time, I noticed the version number in GestureRecognizer.bas was not updated to 1.2. It still says 1.1 although the content is different than the one in the example. I thought I'd mention this in case you meant to change the version number but forgot to do so :)

Thank you once again!

KC
 

JackKirk

Well-Known Member
Licensed User
I was having some troubles coming to grips with narek's class so I spent a day tidying it up and netting it down to its bare essentials.

I changed the example wrapper so that I could individually analyse how each gesture was handled.

I then added a mashup example of all gestures to the example wrapper with some simple ideas as to how to avoid gesture "collisions".

I've asked narek if he would mind my publishing this effort - he was positive with the caveat that I change the classes name to avoid confusion.

Please find the XGestureRecognizer class with example wrapper attached.

The example wrapper has the mashup exposed by default - there are simple instructions in the example wrapper that allow you to expose the individual gesture examples instead.
 

Attachments

Last edited:

iCAB

Well-Known Member
Licensed User
Hi Guys

I am just wondering if anyone else is facing issues with this class.
Tap event not raised all the time ( in my case on average, 1 out of 10 fails)

In particular to be more specific, I am trying to simulate touch panel up event.
By pressing down on a panel and releasing after few seconds.

Thanks in advance
 

Moncai

Member
Licensed User
Narek, thank you for making this wrapperclass, saves a lot of work! I had to make minor adjustments to make it work and I'd like to share my two bugfixes:

B4X:
Private Const mSwipeDirectionLeft=2
Everywhere you use "Private Const", the editor advises it is implicitly typed as string, so I added "As Int".
B4X:
Private Const mSwipeDirectionLeft As Int = 2
And also
B4X:
Type LongPress_Attributes(NumberOfTaps As InputStream, NumberOfTouch As Int, X As Float, Y As Float, Obj As Object)
InputStream should be Int
B4X:
Type LongPress_Attributes(NumberOfTaps As Int, NumberOfTouch As Int, X As Float, Y As Float, Obj As Object)
 
Top