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
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
From the dispatch demo (a click on the green panel is transfered to the red panel):
B4X:
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
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....
I never used a webview since I started writing code in B4A so I won't be of great help here.
And AFAIK, GD solved the problem of Rorry.
In PassTouchEvent, GD dispatches the motion event to another view. There's no wizardry. It's a thing that can be done in Java.
With the donationware version of GD, your problem is very easy to solve. Example:
Dim MEv As Object = GD.CreateMotionEvent(DateEv, DateTime.Now, Action, 45dip, 95dip)
GD.PassTouchEventTo(MEv, MyWebView)
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.
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).
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.