Skip to content

Commit

Permalink
Changing DroidGap back and duplicating code so that we don't have a r…
Browse files Browse the repository at this point in the history
…egression on CB-1568
  • Loading branch information
infil00p committed Oct 25, 2012
1 parent 32526a8 commit 7f4ee7b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion framework/src/org/apache/cordova/CordovaWebView.java
Expand Up @@ -122,7 +122,6 @@ public CordovaWebView(Context context) {
{
Log.d(TAG, "Your activity must implement CordovaInterface to work");
}
this.initWebViewClient(this.cordova);
this.loadConfiguration();
this.setup();
}
Expand Down
16 changes: 13 additions & 3 deletions framework/src/org/apache/cordova/DroidGap.java
Expand Up @@ -301,7 +301,16 @@ public Activity getActivity() {
*/
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));
}

/**
Expand All @@ -311,16 +320,17 @@ public void init() {
* @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,
Expand Down

0 comments on commit 7f4ee7b

Please sign in to comment.