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.


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

Branch: refs/heads/pluggable_webview
Commit: 9d1c72cc07f855d5042a155a18b1b31d1c871560
Parents: 09ac30e
Author: Ningxin Hu <[email protected]>
Authored: Mon Apr 21 15:22:19 2014 +0800
Committer: Ningxin Hu <[email protected]>
Committed: Mon Apr 21 15:22:19 2014 +0800

----------------------------------------------------------------------
 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(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9d1c72cc/framework/src/org/apache/cordova/AndroidWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/AndroidWebView.java 
b/framework/src/org/apache/cordova/AndroidWebView.java
index 00c4bb1..a940dd5 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;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9d1c72cc/framework/src/org/apache/cordova/CordovaActivity.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaActivity.java 
b/framework/src/org/apache/cordova/CordovaActivity.java
index a24555b..8931b51 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

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9d1c72cc/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 f0d4a5f..d23baee 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);

Reply via email to