diff options
| author | Nate Fischer <ntfschr@google.com> | 2019-10-29 00:39:55 -0700 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2019-10-29 00:39:55 -0700 |
| commit | a906395b9effc813054cb5175f0635086d30649d (patch) | |
| tree | ceeb54c99431b9d4e04ada6fbb43d1962f7e42c2 /core/java/android | |
| parent | 52dc96d4c84db21a99ef6989bbeda83ad9ea23ea (diff) | |
| parent | b2bc8ddcfb1466ca92ef1f74e3cdd13af9325b0b (diff) | |
WebView: clarify docs for onShowCustomView am: aaaa660a44 am: 3ea1a6d6ff
am: b2bc8ddcfb
Change-Id: I28eb0e3ffcef7256d3419dbde5bb9bcce2614172
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/webkit/WebChromeClient.java | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java index 4db630808ef1..f8522edb7dcd 100644 --- a/core/java/android/webkit/WebChromeClient.java +++ b/core/java/android/webkit/WebChromeClient.java @@ -71,11 +71,24 @@ public class WebChromeClient { } /** - * Notify the host application that the current page has entered full - * screen mode. The host application must show the custom View which - * contains the web contents — video or other HTML content — - * in full screen mode. Also see "Full screen support" documentation on - * {@link WebView}. + * Notify the host application that the current page has entered full screen mode. After this + * call, web content will no longer be rendered in the WebView, but will instead be rendered + * in {@code view}. The host application should add this View to a Window which is configured + * with {@link android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} flag in order to + * actually display this web content full screen. + * + * <p>The application may explicitly exit fullscreen mode by invoking {@code callback} (ex. when + * the user presses the back button). However, this is generally not necessary as the web page + * will often show its own UI to close out of fullscreen. Regardless of how the WebView exits + * fullscreen mode, WebView will invoke {@link #onHideCustomView()}, signaling for the + * application to remove the custom View. + * + * <p>If this method is not overridden, WebView will report to the web page it does not support + * fullscreen mode and will not honor the web page's request to run in fullscreen mode. + * + * <p class="note"><b>Note:</b> if overriding this method, the application must also override + * {@link #onHideCustomView()}. + * * @param view is the View object to be shown. * @param callback invoke this callback to request the page to exit * full screen mode. @@ -98,10 +111,13 @@ public class WebChromeClient { CustomViewCallback callback) {}; /** - * Notify the host application that the current page has exited full - * screen mode. The host application must hide the custom View, ie. the - * View passed to {@link #onShowCustomView} when the content entered fullscreen. - * Also see "Full screen support" documentation on {@link WebView}. + * Notify the host application that the current page has exited full screen mode. The host + * application must hide the custom View (the View which was previously passed to {@link + * #onShowCustomView(View, CustomViewCallback) onShowCustomView()}). After this call, web + * content will render in the original WebView again. + * + * <p class="note"><b>Note:</b> if overriding this method, the application must also override + * {@link #onShowCustomView(View, CustomViewCallback) onShowCustomView()}. */ public void onHideCustomView() {} |
