cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject [5/9] android commit: Changing DroidGap back and duplicating code so that we don't have a regression on CB-1568
Date Mon, 29 Oct 2012 20:24:54 GMT
Changing DroidGap back and duplicating code so that we don't have a regression on CB-1568


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/f270cde4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/f270cde4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/f270cde4

Branch: refs/heads/master
Commit: f270cde47d8a98bdbdcb39f12035be307cb0e721
Parents: 9de7efd
Author: Joe Bowser <bowserj@apache.org>
Authored: Thu Oct 25 13:18:28 2012 -0700
Committer: Simon MacDonald <simon.macdonald@gmail.com>
Committed: Mon Oct 29 16:21:12 2012 -0400

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaWebView.java     |    1 -
 framework/src/org/apache/cordova/DroidGap.java     |   16 ++++++++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/f270cde4/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index 8dac60d..a870c40 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -124,7 +124,6 @@ public class CordovaWebView extends WebView {
         {
             Log.d(TAG, "Your activity must implement CordovaInterface to work");
         }
-        this.initWebViewClient(this.cordova);
         this.loadConfiguration();
         this.setup();
     }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/f270cde4/framework/src/org/apache/cordova/DroidGap.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java
index dd183f9..927e27e 100755
--- a/framework/src/org/apache/cordova/DroidGap.java
+++ b/framework/src/org/apache/cordova/DroidGap.java
@@ -301,7 +301,16 @@ public class DroidGap extends Activity implements CordovaInterface {
      */
     public void init() {
         CordovaWebView webView = new CordovaWebView(DroidGap.this);
-        this.init(webView, new CordovaChromeClient(this, webView));
+        CordovaWebViewClient webViewClient;
+        if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)
+        {
+            webViewClient = new CordovaWebViewClient(this, webView);
+        }
+        else
+        {
+            webViewClient = new IceCreamCordovaWebViewClient(this, webView);
+        }
+        this.init(webView, webViewClient, new CordovaChromeClient(this, webView));
     }
 
     /**
@@ -311,16 +320,17 @@ public class DroidGap extends Activity implements CordovaInterface {
      * @param webViewClient
      * @param webChromeClient
      */
-    public void init(CordovaWebView webView, CordovaChromeClient webChromeClient) {
+    public void init(CordovaWebView webView, CordovaWebViewClient webViewClient, CordovaChromeClient
webChromeClient) {
         LOG.d(TAG, "DroidGap.init()");
 
         // Set up web container
         this.appView = webView;
         this.appView.setId(100);
 
+        this.appView.setWebViewClient(webViewClient);
         this.appView.setWebChromeClient(webChromeClient);
+        webViewClient.setWebView(this.appView);
         webChromeClient.setWebView(this.appView);
-        webViewClient = appView.viewClient;
 
         this.appView.setLayoutParams(new LinearLayout.LayoutParams(
                 ViewGroup.LayoutParams.MATCH_PARENT,


Mime
View raw message