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.
This commit is contained in:
Ningxin Hu 2014-04-21 15:22:19 +08:00
parent 09ac30ef2e
commit 9d1c72cc07
3 changed files with 7 additions and 1 deletions

View File

@ -1078,4 +1078,8 @@ public class AndroidWebView extends WebView implements CordovaWebView {
super.setLayoutParams(layoutParams); super.setLayoutParams(layoutParams);
} }
@Override
public View getView() {
return this;
}
} }

View File

@ -315,7 +315,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
// Add web view but make it invisible while loading URL // Add web view but make it invisible while loading URL
this.appView.setVisibility(View.INVISIBLE); this.appView.setVisibility(View.INVISIBLE);
this.root.addView((View) this.appView); this.root.addView((View) this.appView.getView());
setContentView(this.root); setContentView(this.root);
// Clear cancel flag // Clear cancel flag

View File

@ -17,6 +17,8 @@ public interface CordovaWebView {
Object pluginManager = null; Object pluginManager = null;
Object jsMessageQueue = null; Object jsMessageQueue = null;
View getView();
void setWebViewClient(CordovaWebViewClient webViewClient); void setWebViewClient(CordovaWebViewClient webViewClient);
void setWebChromeClient(CordovaChromeClient webChromeClient); void setWebChromeClient(CordovaChromeClient webChromeClient);