The donationware version of the Gesture Detector library can do this (with CreateMotionEvent and PassTouchEventTo).i did a try this way,with reflector library,this works well on button,panel... but what i'm trying to do,its to simulate a click on a webview object (on a flash player to be specific)
to me,the better way should be focusing on "dispatchTouchEvent" & "MotionEvent" like this example
http://stackoverflow.com/questions/9787699/programmatically-execute-touch-event-in-android
thank you for your help.
webview1.LoadUrl("javascript:document.elementFromPoint(250, 250)).click();")
From the dispatch demo (a click on the green panel is transfered to the red panel):Can you please provide B4A code to show how to use: dispatchTouchEvent" & "MotionEvent with GD?
Sub GD_Green_onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
Return GD_Green.PassTouchEventTo(MotionEvent, pnlRed)
End Sub
I never used a webview since I started writing code in B4A so I won't be of great help here.Pitty! I assume all that is needed is a couple of lines of code. As B4A user, refering to a Javascript webpage (about the MotionEvent) does not help very much. What I don't understand is how a Gestures Detector can generate gestures by means of code as you seem to reply in thread #4 in reply to Rorry. Please give a bit more guidance, if you can. I doubt whether Rorry solved his problem either....
With the donationware version of GD, your problem is very easy to solve. Example:Please be kind and tell me how Rorry's problem was solved then. The solution is not given in this Forum.
Thank you for your donation.OK, it was not clear to me that support is linked to a (compulsary) donation. I have made a donation 5 minutes ago.
Could you please send version 2.2 of your GD library (as soon as possible)? It took me some time to figure out why I could not find the "createmotionevent" feature in my version of GD (because I was using an older version...
There is also confusion between the "Gestures" and the "Gestures Detector" library; both often use "GD" as variable.
Without CreateMotionEvent, I don't see how you can generate a move with the library.that a move can also be done with your GD library (e.g. by using ACTION_MOVE), which also does not work.
Set the action parameter of CreateMotionEvent to Action_Move and generate at least two moves (in case the scrolling function does not take into account the initial position of Action_Down).Is it possible to use GD to simulate a MOVE action by code? If so, please don't reply with a simple "yes" but tell me how to do it.
I'm amazed that you have to simulate all these operations with a webview. There's no function to scroll a webview? To select and click on a link?
flingScroll(webView1 As WebView, vx As Int, vy As Int)
flingScroll is a poorly documented method of the WebView.
It's included in WebViewExtras as it may be useful but i can find no documentation for it or it's parameters.
vx and vy do not seem to be pixel values - i suspect they are velocity values for the kinetic/fling scroll.
pageDown(webView1 As WebView, scrollToBottom As boolean)
Scroll the contents of webView1 down by half the page size.
scrollToBottom - If true then webView1 will be scrolled to the bottom of the page.
Returns a Boolean value to indicate the success or failure of the scroll.
pageUp(webView1 As WebView, scrollToTop As boolean)
Scroll the contents of webView1 up by half the page size.
scrollToTop - If true then webView1 will be scrolled to the top of the page.
Returns a Boolean value to indicate the success or failure of the scroll.