Search in sources :

Example 1 with BridgeHelper

use of com.github.lzyzsd.jsbridge.BridgeHelper in project JsBridge by lzyzsd.

the class CustomWebView method init.

private void init() {
    this.setVerticalScrollBarEnabled(false);
    this.setHorizontalScrollBarEnabled(false);
    this.getSettings().setJavaScriptEnabled(true);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        WebView.setWebContentsDebuggingEnabled(true);
    }
    bridgeHelper = new BridgeHelper(this);
    this.setWebViewClient(new WebViewClient() {

        @Override
        public void onPageFinished(WebView webView, String s) {
            bridgeHelper.onPageFinished();
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, String s) {
            return bridgeHelper.shouldOverrideUrlLoading(s);
        }
    });
}
Also used : BridgeHelper(com.github.lzyzsd.jsbridge.BridgeHelper) IWebView(com.github.lzyzsd.jsbridge.IWebView) WebView(android.webkit.WebView) WebViewClient(android.webkit.WebViewClient)

Aggregations

WebView (android.webkit.WebView)1 WebViewClient (android.webkit.WebViewClient)1 BridgeHelper (com.github.lzyzsd.jsbridge.BridgeHelper)1 IWebView (com.github.lzyzsd.jsbridge.IWebView)1