B4A Library [Lib] Gesture Detector

Informatix

Expert
Licensed User
Longtime User
v2.01 does the demo project work with this version of the library?
mine is crashing.

What's your Android version?
Could you send the content of your log?

Usually, all I do is tested with the following Android versions: 2.3.6, 3.2, 4.0.3 and 4.1. I never released and will never release something untested.

The only reason I see for a crash is an incompatible Android version (API < 7).
 
Last edited:

vb1992

Well-Known Member
Licensed User
Longtime User
It's working on my home computer, I think my work computer had the new library with the old demo project.

Check the demo gesture_drag with this setting:

Activity.AddView(pnlGreen, 30dip, 30dip, 30dip, 30dip)

is that always detecting the fling/drag on your devices?
 

vb1992

Well-Known Member
Licensed User
Longtime User
Gesture Rotate Image

Simple Gesture Rotate an Image demo
(2 finger rotate)

Needs Library 2 from first post to work..
 

Attachments

  • Gesture_Rotate_Image.zip
    34.4 KB · Views: 440
Last edited:

vb1992

Well-Known Member
Licensed User
Longtime User
Here is a demo to start a vinyl record music track with two fingers rotate (or fling)

someone else can add a DJ scratch sound if they want
 
Last edited:

vb1992

Well-Known Member
Licensed User
Longtime User
"You can add now an event with the Tab shortcut in the IDE."

cool, is that something special you had to add to make that happen?
or does it do this by default when we make a library
I haven't checked myself
 

Informatix

Expert
Licensed User
Longtime User
"You can add now an event with the Tab shortcut in the IDE."

cool, is that something special you had to add to make that happen?
or does it do this by default when we make a library
I haven't checked myself

You declare the events in the library with @Events. Example:
@Events(values = {
"onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object)",
"onPointerDown(ptrIndex As Int, PID As Int, MotionEvent As Object)",
"onPointerUp(ptrIndex As Int, PID As Int, MotionEvent As Object)"
})
 

Mrposull

New Member
Licensed User
Longtime User
onUp event

Hi, I'm new to the library and just playing around with it. So far it looks really good but I can't seem to find an 'onUp' event. What am I missing?

Cheers
 

Mrposull

New Member
Licensed User
Longtime User
OK. I have a related question.

After a single-finger touch and release I get the 'onDown' and 'onSingleTapUp' events just fine.

Now if I place a first-finger touch I get an 'onDown' event, a second-finger touch gives an 'onPointerDown' event. Lift the second-finger and I get an 'onPointerUp' event but lifting the first-finger only triggers a 'onTouch' event.

So my question is if I want to know when the first-finger has been lifted I need to use and decode the 'onTouch' event. Is this correct?

Thanks again.
 

FJS

Active Member
Licensed User
Longtime User
Using library in service module

Hello,
Is it possible to use the listener in a service module?
I'm trying to use it in a live wallpaper and Writting
GD.SetOnGestureListener(Service, "Gesture") gives me a compilation error.
Thanks,
FJS
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…