org.apache.cordova.engine.SystemWebView Java Examples

The following examples show how to use org.apache.cordova.engine.SystemWebView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StandardActivityTest.java    From keemob with MIT License 6 votes vote down vote up
@Test
public void startUriIntentCheck() {
    StandardActivity activity = (StandardActivity) mActivityRule.getActivity();
    final SystemWebView webView = (SystemWebView) activity.getWindow().getCurrentFocus();
    try {
        mActivityRule.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                String uri = webView.getUrl();
                assertFalse(uri.equals(FALSE_URI));
            }
        });
    } catch (Throwable throwable) {
        throwable.printStackTrace();
    }
}
 
Example #2
Source File: EmbeddedWebViewActivity.java    From keemob with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    //Set up the webview
    ConfigXmlParser parser = new ConfigXmlParser();
    parser.parse(this);

    SystemWebView webView = (SystemWebView) findViewById(R.id.cordovaWebView);
    webInterface = new CordovaWebViewImpl(new SystemWebViewEngine(webView));
    webInterface.init(cordovaInterface, parser.getPluginEntries(), parser.getPreferences());

    webView.loadUrl(parser.getLaunchUrl());
}
 
Example #3
Source File: StandardActivityTest.java    From keemob with MIT License 5 votes vote down vote up
@Test
public void webViewCheck() {
    StandardActivity activity = (StandardActivity) mActivityRule.getActivity();
    //Fish the webview out of the mostly locked down Activity using the Android SDK
    View view = activity.getWindow().getCurrentFocus();
    assertEquals(SystemWebView.class, view.getClass());
}
 
Example #4
Source File: StandardActivityTest.java    From keemob with MIT License 5 votes vote down vote up
@Test
public void checkBackgroundIntentCheck() {
    StandardActivity activity = (StandardActivity) mActivityRule.getActivity();
    final SystemWebView webView = (SystemWebView) activity.getWindow().getCurrentFocus();
    CordovaWebView webInterface = webView.getCordovaWebView();
    CordovaPreferences prefs = webInterface.getPreferences();
    assertFalse(prefs.getInteger("backgroundcolor", Color.BLACK) == Color.GREEN);
}
 
Example #5
Source File: MainActivity.java    From chappiecast with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    // Set by <content src="index.html" /> in config.xml
    loadUrl(launchUrl);
    WebSettings ws = ((SystemWebView)super.appView.getView()).getSettings();
    ws.setMediaPlaybackRequiresUserGesture(false);
}
 
Example #6
Source File: InjectWebViewEngine.java    From cordova-plugin-fastrde-injectview with MIT License 4 votes vote down vote up
public InjectWebViewEngine(SystemWebView webView) {
    super(webView);
    webView.setWebViewClient(new InjectWebViewClient(this));
}