public class XWalkUIClient
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
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 |
---|---|
void |
onFullscreenToggled(XWalkView view,
boolean enterFullscreen)
Tell the client to toggle fullscreen mode.
|
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.
|
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 |
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.public 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 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.