Skip to content

Commit f3fdae6

Browse files
macdonstJesse MacFadyen
authored andcommitted
Fixing zoom issue in child browser
1 parent b97551f commit f3fdae6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Android/ChildBrowser/src/com/phonegap/plugins/childBrowser/ChildBrowser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,16 @@ public void onClick(View v) {
294294

295295
webview = new WebView(ctx);
296296
webview.getSettings().setJavaScriptEnabled(true);
297+
webview.getSettings().setBuiltInZoomControls(true);
297298
WebViewClient client = new ChildBrowserClient(ctx, edittext);
298299
webview.setWebViewClient(client);
299300
webview.loadUrl(url);
300301
webview.setId(5);
302+
webview.setInitialScale(0);
301303
webview.setLayoutParams(wvParams);
302304
webview.requestFocus();
305+
webview.requestFocusFromTouch();
306+
303307

304308
toolbar.addView(back);
305309
toolbar.addView(forward);
@@ -371,7 +375,7 @@ public ChildBrowserClient(PhonegapActivity mContext, EditText mEditText) {
371375
public void onPageStarted(WebView view, String url, Bitmap favicon) {
372376
super.onPageStarted(view, url, favicon);
373377
String newloc;
374-
if (url.startsWith("http")) {
378+
if (url.startsWith("http:")) {
375379
newloc = url;
376380
} else {
377381
newloc = "http://" + url;

0 commit comments

Comments
 (0)