diff --git a/JsBridgeWork.png b/JsBridgeWork.png new file mode 100644 index 0000000..ba8d77c Binary files /dev/null and b/JsBridgeWork.png differ diff --git a/README.md b/README.md index 4cb031a..8521142 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ This project make a bridge between Java and JavaScript. It provides safe and convenient way to call Java code from js and call js code from java. +## How JsBridge Work +![JsBridge](./JsBridgeWork.png) + ## Demo ![JsBridge Demo](https://raw.githubusercontent.com/lzyzsd/JsBridge/master/JsBridge.gif) @@ -126,6 +129,22 @@ for example: will print 'JS got a message hello' and 'JS responding with' in webview console. +### Switch to CustomWebview +* activity_main.xml +```xml + + +``` +* MainActivity.java +Class BridgeWebview change to CustomWebview; +```java + CustomWebView webView = (CustomWebView) findViewById(R.id.webView); + +``` + ## Notice This lib will inject a WebViewJavascriptBridge Object to window object.