| java.lang.Object | ||
| ↳ | XWalkUIClientInternal | |
| ↳ | org.xwalk.core.XWalkUIClient | |
This class notifies the embedder UI events/callbacks.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| enum | XWalkUIClient.JavascriptMessageType | The type of JavaScript modal dialog. | |||||||||
| enum | XWalkUIClient.LoadStatus | The status when a page stopped loading | |||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
XWalkUIClient(XWalkView view)
Constructor.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 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, String url, String message, String defaultValue, XWalkJavascriptResult result)
Tell the client to display a prompt dialog to the user.
| ||||||||||
| void |
onPageLoadStarted(XWalkView view, String url)
Notify the host application that a page has started loading.
| ||||||||||
| void |
onPageLoadStopped(XWalkView view, String url, XWalkUIClient.LoadStatus status)
Notify the host application that a page has stopped loading.
| ||||||||||
| void | onReceivedTitle(XWalkViewInternal view, String title) | ||||||||||
| void |
onReceivedTitle(XWalkView view, 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, KeyEvent event)
Notify the host application that a key was not handled by the XWalkView.
| ||||||||||
| void |
openFileChooser(XWalkView view, Tell the client to open a file chooser.
| ||||||||||
| boolean |
shouldOverrideKeyEvent(XWalkView view, KeyEvent event)
Give the host application a chance to handle the key event synchronously.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Tell the client to toggle fullscreen mode.
| view | the owner XWalkView instance. |
|---|---|
| enterFullscreen | true if it has entered fullscreen mode. |
Notify the client to close the given XWalkView.
| view | the owner XWalkView instance. |
|---|
Tell the client to display a prompt dialog to the user.
| 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. |
Notify the host application that a page has started loading. This method is called once for each main frame load so a page with iframes or framesets will call onPageLoadStarted one time for the main frame. This also means that onPageLoadStarted will not be called when the contents of an embedded frame changes, i.e. clicking a link whose target is an iframe.
| view | The XWalkView that is initiating the callback. |
|---|---|
| url | The url to be loaded. |
Notify the host application that a page has stopped loading. This method is called only for main frame. When onPageLoadStopped() is called, the rendering picture may not be updated yet. To get the notification for the new Picture, use XWalkView.PictureListener#onNewPicture.
| view | The XWalkView that is initiating the callback. |
|---|---|
| url | The url of the page. |
| status | the status when the page stopped loading. |
Notify the host application of a change in the document title.
| view | The XWalkView that initiated the callback. |
|---|---|
| title | A String containing the new title of the document. |
Request display and focus for this XWalkView.
| view | the owner XWalkView instance. |
|---|
Notify the client that the scale applied to the XWalkView has changed.
| view | the owner XWalkView instance. |
|---|---|
| oldScale | the old scale before scaling. |
| newScale | the current scale factor after scaling. |
Notify the host application that a key was not handled by the XWalkView. Except system keys, XWalkView always consumes the keys in the normal flow or if shouldOverrideKeyEvent returns true. This is called asynchronously from where the key is dispatched. It gives the host application a chance to handle the unhandled key events.
| view | The XWalkView that is initiating the callback. |
|---|---|
| event | The key event. |
Tell the client to open a file chooser.
| 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 picker |
Give the host application a chance to handle the key event synchronously. e.g. menu shortcut key events need to be filtered this way. If return true, XWalkView will not handle the key event. If return false, XWalkView will always handle the key event, so none of the super in the view chain will see the key event. The default behavior returns false.
| view | The XWalkView that is initiating the callback. |
|---|---|
| event | The key event. |