-
Notifications
You must be signed in to change notification settings - Fork 9
Using da Polyfill
Getting OpenLayers Pinch-Zoom and all the other cool stuff working on 2.x: Grab the latest release version from https://github.com/Philzen/WebView-MultiTouch-Polyfill/tags
and then...
-
Copy wmp.jar into your own projects'
libs
folder -
In your Main Activity, create a new
WebClient
object, passing in theWebView
that you want to enable multitouch on:WebClient wmp = new WebClient(webview);
Refer to the MainActivity of the demo app to see the command in context.
-
As above, but instead of
WebClient
useCordovaWebClient
:CordovaWebClient wmp = new CordovaWebClient(this, appView);
-
Copy WebClient.java and PhonegapWebClient.java from src/com/changeit/wmpolyfill/ into your project. You will need to refactor those classes namespace to match those of your project - some IDEs (i.e. Netbeans) will do that conveniently for you as you paste the files
-
In your Main (
DroidGap
) Activity, instantiate a newPhonegapWebClient
:PhonegapWebClient wmp = new PhonegapWebClient(this, appView);
This solution was tested with Phonegap 1.8.1 and should work with many earlier versions.
-
setPolyfillAllTouches (Boolean) [default:
false
]Per default WMP won't do anything to single hand gestures in order not to interfere with varying event implementations on different devices. If you set this value to
true
, all touches on the webview will be intercepted and emulated in the polyfill.NOTE: The polyfill won't interfere with any touches (basically it will be inactive) if the API Level is 11 or higher (= devices running Android 3+)
Please visit the supported device page and check whether WMP ran on any like yours before, if not, help yourself and others by adding your device name & OS.
In case of problems, please don't hesitate to report a bug including those details.