-
- All Implemented Interfaces:
-
com.horizonfintex.sdk.JSEvaluator
public final class JSWebView implements JSEvaluator
Embedded WebView, it provides a set of javascript functions that supports to create, manipulate the Ethereum keystore. To use this WebView, it has to be added to the view hierarchy, call addToParent(ViewGroup) method to add it to the current view hierarchy.
-
-
Method Summary
Modifier and Type Method Description final Unit
addToParent(ViewGroup parent)
add current webview into the ui hierarchy, need call this function before evaluating the javascript Unit
evaluateJS(String js, ValueCallback<String> callback)
Call webView to evaluate javascript, and gives callback with result -
-
Constructor Detail
-
JSWebView
JSWebView(Context context)
-
-
Method Detail
-
addToParent
final Unit addToParent(ViewGroup parent)
add current webview into the ui hierarchy, need call this function before evaluating the javascript
- Parameters:
parent
-root container view in the hierarchy to hold the webView, any ViewGroup that can add more subviews is fine, the webView won't be visible to user
-
evaluateJS
Unit evaluateJS(String js, ValueCallback<String> callback)
Call webView to evaluate javascript, and gives callback with result
- Parameters:
js
-javascript that going to be evaluated
callback
-a StringValueCallback with the result from javascript evaluation, can be null if there is an error, or no return value from the javascript call
-
-
-
-