mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Changing DroidGap back and duplicating code so that we don't have a regression on CB-1568
This commit is contained in:
parent
32526a8c16
commit
7f4ee7b20a
@ -122,7 +122,6 @@ public class CordovaWebView extends WebView {
|
||||
{
|
||||
Log.d(TAG, "Your activity must implement CordovaInterface to work");
|
||||
}
|
||||
this.initWebViewClient(this.cordova);
|
||||
this.loadConfiguration();
|
||||
this.setup();
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user