Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@Dn-a
Copy link

@Dn-a Dn-a commented Feb 18, 2019

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);

@googlebot
Copy link

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. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

Googlers can find more info about SignCLA and this PR by following this link.

@Dn-a
Copy link
Author

Dn-a commented Feb 18, 2019

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. I signed it!) and we'll verify it.

What to do if you already signed the CLA

Individual signers
* It's possible we don't have your GitHub username or you're using a different email address on your commit. Check [your existing CLA data](https://cla.developers.google.com/clas) and verify that your [email is set on your git commits](https://help.github.com/articles/setting-your-email-in-git/).
Corporate signers
* Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to [go/cla#troubleshoot](http://go/cla#troubleshoot) ([Public version](https://opensource.google.com/docs/cla/#troubleshoot)).

* The email used to register you as an authorized contributor must be the email used for the Git commit. Check [your existing CLA data](https://cla.developers.google.com/clas) and verify that your [email is set on your git commits](https://help.github.com/articles/setting-your-email-in-git/).

* The email used to register you as an authorized contributor must also be [attached to your GitHub account](https://github.com/settings/emails).

Googlers can find more info about SignCLA and this PR by following this link.

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

Googlers can find more info about SignCLA and this PR by following this link.

@bparrishMines bparrishMines changed the title Added the ability to activate the zoom (Android) [webview_flutter] Added the ability to activate the zoom (Android) Feb 22, 2019
Copy link
Contributor

@amirh amirh left a 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:

  1. Add e2e tests in example/test_driver/webview.dart.
  2. Revert the .arb file.


private void updateZoomMode(boolean mode) {
//webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(mode);
Copy link
Contributor

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?

Copy link
Author

@Dn-a Dn-a Mar 30, 2019

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);
Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Author

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;
Copy link
Contributor

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)

Copy link
Author

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});
Copy link
Contributor

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.

@Dn-a
Copy link
Author

Dn-a commented Mar 30, 2019

@amirh I know it is not the right place but I could not find a solution to this problem flutter_plugin_tools, could you help me?

@AkoWu101
Copy link

Any news for this feature? The latest version does not support it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants