I'm writing a Phonegap application with a custom made plugin. This plugin generates a full-screen animated background (essentially a video) on it's own SurfaceView (think of it as a background video). I want the regular phonegap webview to be on top of this plugin, as a transparent overlay. How can I do that?
My current code:
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
final FrameLayout layout = (FrameLayout) webView.getView().getParent();
final Activity activity = cordova.getActivity();
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
try {
// here I insert the surface
// that I want to be placed behind the webview
activity.setContentView(R.layout.preview);
MySurfaceView myView = new MySurfaceView(activity);
FrameLayout preview = (FrameLayout) activity.findViewById(R.id.myview);
preview.addView(myView);
}
catch(Exception e) {
Log.e(CamCapture.TAG, "failed: " + e.getMessage());
}
}
});
}
This question is the opposite of How can I overlay a native view on top of PhoneGap's CordovaWebView in Android?