Search in sources :

Example 1 with WebViewClient

use of com.just.agentweb.WebViewClient in project AgentWeb by Justson.

the class JsbridgeWebFragment method getWebViewClient.

private WebViewClient getWebViewClient() {
    return new WebViewClient() {

        BridgeWebViewClient mBridgeWebViewClient = new BridgeWebViewClient(mBridgeWebView);

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            return mBridgeWebViewClient.shouldOverrideUrlLoading(view, url);
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
            if (mBridgeWebViewClient.shouldOverrideUrlLoading(view, request.getUrl().toString())) {
                return true;
            } else {
                return super.shouldOverrideUrlLoading(view, request);
            }
        }

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            super.onPageStarted(view, url, favicon);
        }

        @Override
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
            mBridgeWebViewClient.onPageFinished(view, url);
        }
    };
}
Also used : Bitmap(android.graphics.Bitmap) WebResourceRequest(android.webkit.WebResourceRequest) BridgeWebViewClient(com.github.lzyzsd.jsbridge.BridgeWebViewClient) BridgeWebView(com.github.lzyzsd.jsbridge.BridgeWebView) WebView(android.webkit.WebView) BridgeWebViewClient(com.github.lzyzsd.jsbridge.BridgeWebViewClient) WebViewClient(com.just.agentweb.WebViewClient)

Aggregations

Bitmap (android.graphics.Bitmap)1 WebResourceRequest (android.webkit.WebResourceRequest)1 WebView (android.webkit.WebView)1 BridgeWebView (com.github.lzyzsd.jsbridge.BridgeWebView)1 BridgeWebViewClient (com.github.lzyzsd.jsbridge.BridgeWebViewClient)1 WebViewClient (com.just.agentweb.WebViewClient)1