Link to home
Start Free TrialLog in
Avatar of madam mar
madam mar

asked on

Firemonkey android webbrowser and gesture

i asked the question in many places and seems no know are really know how this can be solved

i a trying to apply a on gesture event to the Twebbrowser
 but it seems it does not work at all .

here is how i place the Twebbrowser

1 - i  added Tlayout
2 - i added inside the Tlayout a Tpanel
3- i added inside the tpanel a Twebbrowser

also i have set webbrowser.hittest To True , then i dropped a gesture manager to the form then i set the gesture manager to the Twebbrowser Touch property .

then on gesture manager i have added the following code

if EventInfo.GestureID = sgiLeft then
begin
 
showmessage('left moved');
 
 
Handled := true;
end;

Open in new window


sadly when i move my finger left or right it does not detect the gesture and never show the message that i set

why i cannot use gesture in twebbrowser ?
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Yes, found it too...
Because webbrowser on win platform is a wrapper over IE, on android platform is over native webview class.
This way, almost all is handled in webview and it is set as a topmost window over your form. So, any layout can't be "over" webview.
I think that only way is to do something similar how Emb. do it in FMX.Maps.Android unit.  
They use androids GestureDetector class.
(look for InitGestureDetector, TDoubleTapListener, ....)
All of this requires a lot of work.

why you need this feature ?
Avatar of madam mar
madam mar

ASKER

i really needed to adjust some tlayout position when i move my finger left or right over webbrowser
What page (site) do you want to track? Is this for global usage? Do you consider using another implementation of web browser
like HTML rendering library. This one should work as it is native for Delphi.
i tried this component it has various bugs that a destroyer to an android app . is there other alternative to htmlcomponent that you know ?
ASKER CERTIFIED SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it isn't compatible with seattle version