From 41c6486351f965244fc4c7a16816e8218fb03dc5 Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Fri, 25 Oct 2019 16:38:30 -0400 Subject: [PATCH] WebView: note deprecation of onscreen zoom controls. Inform developers that having onscreen zoom controls is deprecated and that it's therefore not recommended to enable them in WebView, with reference to ZoomButtonsController (which is what WebView uses to implement them). Bug: 141732094 Test: make ds-docs Change-Id: I134551b87d3a93072e28aef56667507214b3e9c4 --- core/java/android/webkit/WebSettings.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index 7282008f7e3a7..2895621f962a5 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -328,6 +328,9 @@ public abstract class WebSettings { *

* The built-in mechanisms are the only currently supported zoom * mechanisms, so it is recommended that this setting is always enabled. + * However, on-screen zoom controls are deprecated in Android (see + * {@link android.widget.ZoomButtonsController}) so it's recommended to + * disable {@link #setDisplayZoomControls}. * * @param enabled whether the WebView should use its built-in zoom mechanisms */ @@ -347,7 +350,9 @@ public abstract class WebSettings { /** * Sets whether the WebView should display on-screen zoom controls when * using the built-in zoom mechanisms. See {@link #setBuiltInZoomControls}. - * The default is {@code true}. + * The default is {@code true}. However, on-screen zoom controls are deprecated + * in Android (see {@link android.widget.ZoomButtonsController}) so it's + * recommended to set this to {@code false}. * * @param enabled whether the WebView should display on-screen zoom controls */