public class XWalkUIClient
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XWalkUIClient.ConsoleMessageType
Initiator
|
static class |
XWalkUIClient.InitiateBy
Initiator
|
static class |
XWalkUIClient.JavascriptMessageType
The type of JavaScript modal dialog.
|
static class |
XWalkUIClient.LoadStatus
The status when a page stopped loading
|
| Constructor and Description |
|---|
XWalkUIClient(XWalkView view)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
getBridge() |
boolean |
onConsoleMessage(XWalkView view,
java.lang.String message,
int lineNumber,
java.lang.String sourceId,
XWalkUIClient.ConsoleMessageType messageType)
Notify the host application of console message.
|
boolean |
onCreateWindowRequested(XWalkView view,
XWalkUIClient.InitiateBy initiator,
android.webkit.ValueCallback<XWalkView> callback)
Request the host application to create a new window
|
void |
onFullscreenToggled(XWalkView view,
boolean enterFullscreen)
Tell the client to toggle fullscreen mode.
|
void |
onIconAvailable(XWalkView view,
java.lang.String url,
android.os.Message startDownload)
Notify the host application that an icon is available, send the message to start the downloading
|
void |
onJavascriptCloseWindow(XWalkView view)
Notify the client to close the given XWalkView.
|
boolean |
onJavascriptModalDialog(XWalkView view,
XWalkUIClient.JavascriptMessageType type,
java.lang.String url,
java.lang.String message,
java.lang.String defaultValue,
XWalkJavascriptResult result)
Tell the client to display a prompt dialog to the user.
|
boolean |
onJsAlert(XWalkView view,
java.lang.String url,
java.lang.String message,
XWalkJavascriptResult result)
Tell the client to display an alert dialog to the user.
|
boolean |
onJsConfirm(XWalkView view,
java.lang.String url,
java.lang.String message,
XWalkJavascriptResult result)
Tell the client to display a confirm dialog to the user.
|
boolean |
onJsPrompt(XWalkView view,
java.lang.String url,
java.lang.String message,
java.lang.String defaultValue,
XWalkJavascriptResult result)
Tell the client to display a prompt dialog to the user.
|
void |
onPageLoadStarted(XWalkView view,
java.lang.String url)
Notify the host application that a page has started loading.
|
void |
onPageLoadStopped(XWalkView view,
java.lang.String url,
XWalkUIClient.LoadStatus status)
Notify the host application that a page has stopped loading.
|
void |
onReceivedIcon(XWalkView view,
java.lang.String url,
android.graphics.Bitmap icon)
Notify the host application of a new icon has been downloaded
|
void |
onReceivedTitle(XWalkView view,
java.lang.String title)
Notify the host application of a change in the document title.
|
void |
onRequestFocus(XWalkView view)
Request display and focus for this XWalkView.
|
void |
onScaleChanged(XWalkView view,
float oldScale,
float newScale)
Notify the client that the scale applied to the XWalkView has changed.
|
void |
onUnhandledKeyEvent(XWalkView view,
android.view.KeyEvent event)
Notify the host application that a key was not handled by the XWalkView.
|
void |
openFileChooser(XWalkView view,
android.webkit.ValueCallback<android.net.Uri> uploadFile,
java.lang.String acceptType,
java.lang.String capture)
Tell the client to open a file chooser.
|
boolean |
shouldOverrideKeyEvent(XWalkView view,
android.view.KeyEvent event)
Give the host application a chance to handle the key event synchronously.
|
public XWalkUIClient(XWalkView view)
view - the owner XWalkView instance.protected java.lang.Object getBridge()
public boolean onCreateWindowRequested(XWalkView view, XWalkUIClient.InitiateBy initiator, android.webkit.ValueCallback<XWalkView> callback)
view - The XWalkView which initiate the request for a new windowinitiator - How the request was initiatedcallback - Callback when once a new XWalkView has been createdpublic void onIconAvailable(XWalkView view, java.lang.String url, android.os.Message startDownload)
view - The XWalkView that icon belongs tourl - The icon urlstartDownload - Message to initiate icon downloadpublic void onReceivedIcon(XWalkView view, java.lang.String url, android.graphics.Bitmap icon)
view - The XWalkView that icon belongs tourl - The icon urlicon - The icon imagepublic void onRequestFocus(XWalkView view)
view - the owner XWalkView instance.public void onJavascriptCloseWindow(XWalkView view)
view - the owner XWalkView instance.public boolean onJavascriptModalDialog(XWalkView view, XWalkUIClient.JavascriptMessageType type, java.lang.String url, java.lang.String message, java.lang.String defaultValue, XWalkJavascriptResult result)
view - the owner XWalkView instance.type - the type of JavaScript modal dialog.url - the url of the web page which wants to show this dialog.message - the message to be shown.defaultValue - the default value string. Only valid for Prompt dialog.result - the callback to handle the result from caller.public void onFullscreenToggled(XWalkView view, boolean enterFullscreen)
view - the owner XWalkView instance.enterFullscreen - true if it has entered fullscreen mode.public void openFileChooser(XWalkView view, android.webkit.ValueCallback<android.net.Uri> uploadFile, java.lang.String acceptType, java.lang.String capture)
view - the owner XWalkView instance.uploadFile - the callback class to handle the result from caller. It MUST
be invoked in all cases. Leave it not invoked will block all following
requests to open file chooser.acceptType - value of the 'accept' attribute of the input tag associated
with this file picker.capture - value of the 'capture' attribute of the input tag associated
with this file pickerpublic void onScaleChanged(XWalkView view, float oldScale, float newScale)
view - the owner XWalkView instance.oldScale - the old scale before scaling.newScale - the current scale factor after scaling.public boolean shouldOverrideKeyEvent(XWalkView view, android.view.KeyEvent event)
view - The XWalkView that is initiating the callback.event - The key event.public void onUnhandledKeyEvent(XWalkView view, android.view.KeyEvent event)
view - The XWalkView that is initiating the callback.event - The key event.public boolean onConsoleMessage(XWalkView view, java.lang.String message, int lineNumber, java.lang.String sourceId, XWalkUIClient.ConsoleMessageType messageType)
view - The XWalkView that initiated the callback.message - A String containing the console message.lineNumber - The line number of JavaScript.sourceId - The link which print log.messageType - The type of console message.public void onReceivedTitle(XWalkView view, java.lang.String title)
view - The XWalkView that initiated the callback.title - A String containing the new title of the document.public void onPageLoadStarted(XWalkView view, java.lang.String url)
view - The XWalkView that is initiating the callback.url - The url to be loaded.public void onPageLoadStopped(XWalkView view, java.lang.String url, XWalkUIClient.LoadStatus status)
view - The XWalkView that is initiating the callback.url - The url of the page.status - The status when the page stopped loading.public boolean onJsAlert(XWalkView view, java.lang.String url, java.lang.String message, XWalkJavascriptResult result)
view - the owner XWalkView instance.url - the url of the web page which wants to show this dialog.message - the message to be shown.result - the callback to handle the result from caller.public boolean onJsConfirm(XWalkView view, java.lang.String url, java.lang.String message, XWalkJavascriptResult result)
view - the owner XWalkView instance.url - the url of the web page which wants to show this dialog.message - the message to be shown.result - the callback to handle the result from caller.public boolean onJsPrompt(XWalkView view, java.lang.String url, java.lang.String message, java.lang.String defaultValue, XWalkJavascriptResult result)
view - the owner XWalkView instance.url - the url of the web page which wants to show this dialog.message - the message to be shown.defaultValue - the default value string. Only valid for Prompt dialog.result - the callback to handle the result from caller.