From f3fdae6ce9c1f623cde502e86f588b400b87763c Mon Sep 17 00:00:00 2001 From: macdonst Date: Wed, 19 Oct 2011 09:26:50 +0800 Subject: [PATCH] Fixing zoom issue in child browser --- .../src/com/phonegap/plugins/childBrowser/ChildBrowser.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Android/ChildBrowser/src/com/phonegap/plugins/childBrowser/ChildBrowser.java b/Android/ChildBrowser/src/com/phonegap/plugins/childBrowser/ChildBrowser.java index 7c721865..4be68044 100644 --- a/Android/ChildBrowser/src/com/phonegap/plugins/childBrowser/ChildBrowser.java +++ b/Android/ChildBrowser/src/com/phonegap/plugins/childBrowser/ChildBrowser.java @@ -294,12 +294,16 @@ public void onClick(View v) { webview = new WebView(ctx); webview.getSettings().setJavaScriptEnabled(true); + webview.getSettings().setBuiltInZoomControls(true); WebViewClient client = new ChildBrowserClient(ctx, edittext); webview.setWebViewClient(client); webview.loadUrl(url); webview.setId(5); + webview.setInitialScale(0); webview.setLayoutParams(wvParams); webview.requestFocus(); + webview.requestFocusFromTouch(); + toolbar.addView(back); toolbar.addView(forward); @@ -371,7 +375,7 @@ public ChildBrowserClient(PhonegapActivity mContext, EditText mEditText) { public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); String newloc; - if (url.startsWith("http")) { + if (url.startsWith("http:")) { newloc = url; } else { newloc = "http://" + url;