You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/04/30 21:53:06 UTC

[08/12] android commit: Add getView() API into CordovaWebView.

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/8408da55
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/8408da55
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/8408da55

Branch: refs/heads/pluggable_webview
Commit: 8408da55ea2fa112b4faeec5ae70f5780eb4f4c0
Parents: 4a67dd2
Author: Ningxin Hu <ni...@intel.com>
Authored: Mon Apr 21 15:22:19 2014 +0800
Committer: Ian Clelland <ic...@chromium.org>
Committed: Tue Apr 29 22:50:11 2014 -0400

----------------------------------------------------------------------
 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/8408da55/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/8408da55/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/8408da55/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);