B4A Library [Lib] Gesture Detector

TheMightySwe

Active Member
Licensed User
Longtime User
Thanks anyway, my objective for now is meet. Love it, now the resizing problem needs to be solved, because the GestureListner is not Dimmed in Globals, but it should work with some kind of workaround there.

But that is no hurry with that, lots of things more importnat for the moment.

Once again, Thanks!
 

luke2012

Well-Known Member
Licensed User
Longtime User

How to catch a left or right scroll ?
 

RayLee

Member
Licensed User
Longtime User
I'm sorry to get an error message, when I tested the project of 'GestureDetector_Dispatch'.

If i click the green panel, it raises :

B4X:
Sub GD_Green_onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
    Log("GREEN_Touch action=" & Action & ", x=" & X & ", y=" & Y & ", ev=" & MotionEvent)
    Return GD_Green.PassTouchEventTo(MotionEvent, pnlRed)
End Sub

GREEN_Touch action=0, x=119, y=94, ev=MotionEvent{b66f62a0 action=0 x=119.0 y=94.0 pressure=1.0 size=0.0}


Unexpected event (missing RaiseSynchronousEvents): gd_red_ontouch
Check the unfiltered logs for the full stack trace.
Error occurred on line: 61 (main)


java.lang.NullPointerException
at flm.b4a.gesturedetector.GestureDetectorForB4A$1.onTouch(GestureDetectorForB4A.java:111)
at android.view.View.dispatchTouchEvent(View.java:3881)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
at flm.b4a.gesturedetector.GestureDetectorForB4A.PassTouchEventTo(GestureDetectorForB4A.java:412)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:485)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:174)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at flm.b4a.gesturedetector.GestureDetectorForB4A$1.onTouch(GestureDetectorForB4A.java:111)
at android.view.View.dispatchTouchEvent(View.java:3881)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)

OP: android 2.3
 

Informatix

Expert
Licensed User
Longtime User
It's probably due to the Rapid Debugger mode. Try to use the Legacy mode instead.
 

Swissmade

Well-Known Member
Licensed User
Longtime User
I wonder if CreateMotionEvent in version 2.1 can be used in a image stream.

Cheers,
Swissmade
 

Swissmade

Well-Known Member
Licensed User
Longtime User
I will,

Motion detection on Images when something is moving.
Images from a IP-Camera.
 

Swissmade

Well-Known Member
Licensed User
Longtime User
Ok thanks,

Sorry to not read all of the post.
Very busy here to read all.

Thanks for help

Cheers,
Swissmade
 

kiki78

Active Member
Licensed User
Longtime User
Hello Informatix,

I've made custom view with B4A class and I want add gesture detection on it.
Is it possible and how to receive event inside class ?

Regards
 

kiki78

Active Member
Licensed User
Longtime User
Sorry I make mistake with eventPrefix parameter and so I never receive events .

Regards
 

kiki78

Active Member
Licensed User
Longtime User
Thank you Informatix.
Since I corrected eventPrefix all work fine

Regards
 

kiki78

Active Member
Licensed User
Longtime User
Hello Informatix,

I try to use "onLongPress" event.
This event work, but when I want to use it to show preference screen, I obtain following error :
B4X:
java.lang.NullPointerException
    at flm.b4a.gesturedetector.GestureDetectorForB4A$1.onTouch(GestureDetectorForB4A.java:89)
    at android.view.View.dispatchTouchEvent(View.java:7345)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2464)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2197)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2470)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2212)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2151)
    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1480)
    at android.app.Activity.dispatchTouchEvent(Activity.java:2469)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2099)
    at android.view.View.dispatchPointerEvent(View.java:7535)
    at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3492)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3424)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4534)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4512)
    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4616)
    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:125)
    at android.os.Looper.loop(Looper.java:124)
    at android.app.ActivityThread.main(ActivityThread.java:4921)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
    at dalvik.system.NativeStart.main(Native Method)

Have you some explanations or advises ?

Regards
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…