Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update to last pull, for zoom controls on TIMOB-4844 #512

Closed
wants to merge 2 commits into from

2 participants

@chris

Per Don's comment on my last pull request - where I was only setting the enable zoom property on creation, with support for doing so later, here's an update.

@negupta

Chris - Did you sign a CLA? If yes, please provide me the sign date and email address that you signed it with.

@chris
@negupta

Thanks, Chris. This issue has been addressed already.

@negupta negupta closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 29, 2011
  1. @chris

    Set supportsZoom on WebView to same value as setBuiltInZoomControls t…

    chris authored
    …o ensure WebView zoom controls enabled/disaled for all devices.
  2. @chris
This page is out of date. Refresh to see the latest.
View
10 android/modules/ui/src/ti/modules/titanium/ui/widget/webview/TiUIWebView.java
@@ -84,16 +84,15 @@ public TiUIWebView(TiViewProxy proxy)
settings.setJavaScriptEnabled(true);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
- settings.setSupportZoom(true);
settings.setLoadsImagesAutomatically(true);
settings.setLightTouchEnabled(true);
+ boolean enableZoom = true; // enable zoom controls by default
if(proxy.hasProperty(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS)) {
- settings.setBuiltInZoomControls(TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS)));
- } else {
- // enable zoom controls by default
- settings.setBuiltInZoomControls(true);
+ enableZoom = TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS));
}
+ settings.setBuiltInZoomControls(enableZoom);
+ settings.setSupportZoom(enableZoom);
// We can only support webview settings for plugin/flash in API 8 and higher.
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ECLAIR_MR1) {
@@ -482,6 +481,7 @@ public void resumeWebView()
public void setEnableZoomControls(boolean enabled)
{
getWebView().getSettings().setBuiltInZoomControls(enabled);
+ getWebView().getSettings().setSupportZoom(enabled);
}
public boolean canGoBack() {
Something went wrong with that request. Please try again.