From 09ac30ef2e5621f517cd01961cb91e8fd53c91e9 Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Mon, 21 Apr 2014 15:17:23 +0800 Subject: [PATCH 1/2] Crosswalk runtime needs the two permissions to auto detect connection status. See more details at: https://crosswalk-project.org/jira/browse/XWALK-1324 --- bin/templates/project/AndroidManifest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/templates/project/AndroidManifest.xml b/bin/templates/project/AndroidManifest.xml index 8a57854c..dba1b445 100644 --- a/bin/templates/project/AndroidManifest.xml +++ b/bin/templates/project/AndroidManifest.xml @@ -29,6 +29,8 @@ /> + + From 9d1c72cc07f855d5042a155a18b1b31d1c871560 Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Mon, 21 Apr 2014 15:22:19 +0800 Subject: [PATCH 2/2] Add getView() API into CordovaWebView. This API is to get the actual View. The concrete webview implementation can use compositing instead of extending underlying webview. --- framework/src/org/apache/cordova/AndroidWebView.java | 4 ++++ framework/src/org/apache/cordova/CordovaActivity.java | 2 +- framework/src/org/apache/cordova/CordovaWebView.java | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/AndroidWebView.java b/framework/src/org/apache/cordova/AndroidWebView.java index 00c4bb10..a940dd5d 100755 --- a/framework/src/org/apache/cordova/AndroidWebView.java +++ b/framework/src/org/apache/cordova/AndroidWebView.java @@ -1078,4 +1078,8 @@ public class AndroidWebView extends WebView implements CordovaWebView { super.setLayoutParams(layoutParams); } + @Override + public View getView() { + return this; + } } diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index a24555b1..8931b518 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -315,7 +315,7 @@ public class CordovaActivity extends Activity implements CordovaInterface { // Add web view but make it invisible while loading URL this.appView.setVisibility(View.INVISIBLE); - this.root.addView((View) this.appView); + this.root.addView((View) this.appView.getView()); setContentView(this.root); // Clear cancel flag diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index f0d4a5f6..d23baeec 100644 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -17,6 +17,8 @@ public interface CordovaWebView { Object pluginManager = null; Object jsMessageQueue = null; + View getView(); + void setWebViewClient(CordovaWebViewClient webViewClient); void setWebChromeClient(CordovaChromeClient webChromeClient);