GitToTheHub commented on code in PR #1023:
URL:
https://github.com/apache/cordova-plugin-inappbrowser/pull/1023#discussion_r3201079692
##########
src/android/InAppBrowser.java:
##########
@@ -946,7 +953,11 @@ public boolean onShowFileChooser (WebView webView,
ValueCallback<Uri[]> filePath
WebSettings settings = inAppWebView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
- settings.setBuiltInZoomControls(showZoomControls);
+ // Enables built-in zoom mechanisms, which are on-screen zoom
controls and pinch-to-zoom.
+ // The on-screen zoom controls have to be enabled/disabled
separately after.
+ // The on-screen zoom controls are deprecated since Android
API Level 26 (Android 8).
Review Comment:
Please change the comment:
```java
// setBuiltInZoomControls enables pinch-to-zoom and also the on-screen zoom
controls
// The zoom controls have to be disabled separately by setDisplayZoomControls
// This is the recommended way by Google
```
##########
src/android/InAppBrowser.java:
##########
@@ -946,7 +953,11 @@ public boolean onShowFileChooser (WebView webView,
ValueCallback<Uri[]> filePath
WebSettings settings = inAppWebView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
- settings.setBuiltInZoomControls(showZoomControls);
+ // Enables built-in zoom mechanisms, which are on-screen zoom
controls and pinch-to-zoom.
+ // The on-screen zoom controls have to be enabled/disabled
separately after.
+ // The on-screen zoom controls are deprecated since Android
API Level 26 (Android 8).
+ settings.setBuiltInZoomControls(enableZoom);
+ settings.setDisplayZoomControls(showZoomControls);
Review Comment:
Please add a comment here:
```java
// Enable/Disable on-screen zoom controls.
// These are deprecated since Android API Level 26 (Android 8).
// Google recommends to disable them
```
##########
README.md:
##########
@@ -119,7 +119,8 @@ instance, or the system browser.
- __navigationbuttoncolor__: set to a valid hex color string, for example:
`#00ff00`, and it will change the color of both navigation buttons from
default. Only has effect if user has location set to `yes` and not
hidenavigationbuttons set to `yes`.
- __toolbarcolor__: set to a valid hex color string, for example:
`#00ff00`, and it will change the color the toolbar from default. Only has
effect if user has location set to `yes`.
- __lefttoright__: Set to `yes` to swap positions of the navigation
buttons and the close button. Specifically, navigation buttons go to the right
and close button to the left. Default value is `no`.
- - __zoom__: set to `yes` to show Android browser's zoom controls, set to
`no` to hide them. Default value is `yes`.
+ - __zoom__: Enables pinch-to-zoom gesture. Set to `no` to disable it.
Default value is `yes`.
+ - __zoomcontrols__: set to `yes` to show Android browser's zoom controls,
set to `no` to hide them. Default value is `yes`.
Review Comment:
Please change the documentation of `zoomcontrols`:
```md
- __zoomcontrols__: set to `yes` to show Android browser's zoom controls,
set to `no` to hide them. Default value is `yes`. The zoom controls are
deprecated since Android API Level 26 (Android 8). Google recommends to disable
them.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]