Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Closed
wants to merge 2 commits into from

2 participants

Chris Bailey Neeraj Gupta
Chris Bailey

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.

Neeraj Gupta
Owner

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

Chris Bailey
Neeraj Gupta
Owner

Thanks, Chris. This issue has been addressed already.

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

Showing 2 unique commits by 1 author.

Sep 29, 2011
Chris Bailey chris Set supportsZoom on WebView to same value as setBuiltInZoomControls t…
…o ensure WebView zoom controls enabled/disaled for all devices.
37985bf
Chris Bailey chris Call setSupportZoom not just on creation, but anytime enable zoom pro…
…perties change.
4ecfad5
This page is out of date. Refresh to see the latest.
10 android/modules/ui/src/ti/modules/titanium/ui/widget/webview/TiUIWebView.java
@@ -84,16 +84,15 @@ public TiUIWebView(TiViewProxy proxy)
84 84 settings.setJavaScriptEnabled(true);
85 85 settings.setSupportMultipleWindows(true);
86 86 settings.setJavaScriptCanOpenWindowsAutomatically(true);
87   - settings.setSupportZoom(true);
88 87 settings.setLoadsImagesAutomatically(true);
89 88 settings.setLightTouchEnabled(true);
90 89
  90 + boolean enableZoom = true; // enable zoom controls by default
91 91 if(proxy.hasProperty(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS)) {
92   - settings.setBuiltInZoomControls(TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS)));
93   - } else {
94   - // enable zoom controls by default
95   - settings.setBuiltInZoomControls(true);
  92 + enableZoom = TiConvert.toBoolean(proxy.getProperty(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS));
96 93 }
  94 + settings.setBuiltInZoomControls(enableZoom);
  95 + settings.setSupportZoom(enableZoom);
97 96
98 97 // We can only support webview settings for plugin/flash in API 8 and higher.
99 98 if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ECLAIR_MR1) {
@@ -482,6 +481,7 @@ public void resumeWebView()
482 481 public void setEnableZoomControls(boolean enabled)
483 482 {
484 483 getWebView().getSettings().setBuiltInZoomControls(enabled);
  484 + getWebView().getSettings().setSupportZoom(enabled);
485 485 }
486 486
487 487 public boolean canGoBack() {

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.