List of usage examples for org.apache.cordova CordovaPreferences getBoolean
public boolean getBoolean(String name, boolean defaultValue)
From source file:org.crosswalk.engine.XWalkCordovaWebView.java
License:Apache License
@Override public void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, Whitelist internalWhitelist, Whitelist externalWhitelist, CordovaPreferences preferences) { if (this.cordova != null) { throw new IllegalStateException(); }//from www . ja v a 2 s .c o m this.cordova = cordova; this.internalWhitelist = internalWhitelist; this.externalWhitelist = externalWhitelist; this.preferences = preferences; pluginManager = new PluginManager(this, this.cordova, pluginEntries); resourceApi = new CordovaResourceApi(webview.getContext(), pluginManager); bridge = new CordovaBridge(pluginManager, new NativeToJsMessageQueue(this, cordova), this.cordova.getActivity().getPackageName()); pluginManager.addService("CoreAndroid", "org.apache.cordova.CoreAndroid"); initWebViewSettings(); webview.init(this); exposeJsInterface(); if (preferences.getBoolean("DisallowOverscroll", false)) { webview.setOverScrollMode(View.OVER_SCROLL_NEVER); } }
From source file:org.crosswalk.engine.XWalkCordovaWebViewImpl.java
License:Apache License
@Override public void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences) { if (this.cordova != null) { throw new IllegalStateException(); }//w w w. j a v a2s . co m this.cordova = cordova; this.preferences = preferences; pluginManager = new PluginManager(this, this.cordova, pluginEntries); resourceApi = new CordovaResourceApi(engine.getView().getContext(), pluginManager); nativeToJsMessageQueue = new NativeToJsMessageQueue(); nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.NoOpBridgeMode()); nativeToJsMessageQueue.addBridgeMode(new NativeToJsMessageQueue.LoadUrlBridgeMode(engine, cordova)); if (preferences.getBoolean("DisallowOverscroll", false)) { engine.getView().setOverScrollMode(View.OVER_SCROLL_NEVER); } engine.init(this, cordova, engineClient, resourceApi, pluginManager, nativeToJsMessageQueue); // This isn't enforced by the compiler, so assert here. assert engine.getView() instanceof CordovaWebViewEngine.EngineView; pluginManager.addService(CoreAndroid.PLUGIN_NAME, "org.apache.cordova.CoreAndroid"); pluginManager.init(); }