-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter] Added the ability to activate the zoom (Android) #1235
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
Googlers can find more info about SignCLA and this PR by following this link. |
I signed it! |
|
CLAs look good, thanks! Googlers can find more info about SignCLA and this PR by following this link. |
amirh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
I left a few comments, other than that we will need to:
- Add e2e tests in
example/test_driver/webview.dart. - Revert the .arb file.
|
|
||
| private void updateZoomMode(boolean mode) { | ||
| //webView.getSettings().setLoadWithOverviewMode(true); | ||
| webView.getSettings().setUseWideViewPort(mode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this tied to the zoom mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the value is true and the page contains the viewport meta tag, the value of the width specified in the tag is used. If the page does not contain the tag or does not provide a width, then a wide viewport will be used. actually i can remove mode and leave it on true. do you suggest to create another parameter for separate management?
| } | ||
|
|
||
| private void updateZoomMode(boolean mode) { | ||
| //webView.getSettings().setLoadWithOverviewMode(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this line
| final Set<JavascriptChannel> javascriptChannels; | ||
|
|
||
|
|
||
| /// Enable/Disable zoom. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to do the same on iOS?
If yes we should support that as well, if no the comment should mention that this is a no-op on iOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the moment I have no way to test the ios environment. I will modify the comment in on-op on ios
|
|
||
|
|
||
| /// Enable/Disable zoom. | ||
| final bool zoom; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd suggest calling this zoomEnabled (I can imagine a parameter named zoom being used to set a zoom level)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, of course
| this.javascriptMode, | ||
| }); | ||
|
|
||
| _WebSettings({this.javascriptMode, this.zoom}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this worked has changed a bit, please rebase and use the widget reference.
|
@amirh I know it is not the right place but I could not find a solution to this problem |
|
Any news for this feature? The latest version does not support it |
I added the ability to enable zooming on Android WebView.
by default it is set to false.
Pop-up zoom control is disabled, dialog is not responding to touch events.
webView.getSettings().setDisplayZoomControls(false);