Webview control uses and architecture ideas

Webview control uses and architecture

Custom WebView as a use of external controls, and to build on existing establishment interact. use:

Use the control in xml

Control supports global configuration property and private property configuration:
Global configured to:

1. Supports the need to intercept the incoming of Action, and a need to intercept the HashMap (which is the need to intercept the name of Action);

2. Support passed a total of interceptors, and block use of the above Action together, using each other

3. Support incoming webView load a View as a time of waiting and underpinning animated pictures

4. Support incoming network request parameters
local configuration:
1. Support for the need to intercept incoming local Action (2 methods)

1.1. Incoming Local Action, but will override the global interception Action 1.2. Incoming Local Action, will not override the global interception Action 2. Support H5 incoming callback method is not intercepted, as the processing method

The first parameter is the second parameter of the Action H5 H5 return parameters in the intermediate layer with the iterator traverses JSON, all added to the map, the third parameter is transmitted back JSON H5, enabling developers to easily see source data

3. Support incoming local interceptors

Over the global local interceptor interceptor.

(The reason why the interceptor and the need to intercept the string to do the separation, in order to facilitate mixed use, with a total of intercepting private character Action interceptors, with a total of interceptors to intercept private string)

Webview itself can begin available methods
1. Set the Webview Ua (setAppUa)
2. obtained WebView (getWebView)
3. Set H5 and interactive objects (setAppObjec) 4. Conveniently obtained using treatment class local configuration (getJsInThemiddle) 5. obtained Torr bottom picture of View (getPladview)

Callback method (nativeCallBack) 6.H5 of
7 native H5 initiative calling method (callBackH5)
8. destroyed Webviwe, (at the time of the destruction of the interface must be invoked to prevent memory overflow) (clearWebview) 9. Set webview background image (setBackgroud) ;

Guess you like

Origin blog.csdn.net/a1033479126/article/details/88838121