ks32 / CrosswalkNative

Embedded Crosswalk 77 webview based sample project.
95 stars 42 forks source link

setBackgroundColor() don`t work #46

Closed maxiannunziata closed 1 year ago

maxiannunziata commented 1 year ago

Hi,

I need to put a video view on the bottom of a webview.

When I put: mXWalkView.setBackgroundColor(0x00000000); The background don't turn in transparent mode, always the background is white.

When I put:

mXWalkView.setBackgroundColor(Color.RED); Or any other color, works correctly. but the Color.TRANSPARENT don't work.

any suggestion?

maxiannunziata commented 1 year ago

I found this:


 @Override
  public final void onXWalkInitCompleted() {

    setContentView(R.layout.xwview_transparent_layout);
    StringBuffer mess = new StringBuffer();
    mess.append("Test Purpose: \n\n")
        .append(
            "Check XWalkView's transparent feature whether display the view under the webview.\n\n")
        .append("Expected Result:\n\n")
        .append("Test passes if you can see button view & blue imageview");
    new AlertDialog.Builder(this)
        .setTitle("Info")
        .setMessage(mess.toString())
        .setPositiveButton("confirm", null)
        .show();
    mXWalkView = (XWalkView) findViewById(R.id.xwalkview_transparent);
    mXWalkView.setZOrderOnTop(true);
    mXWalkView.setBackgroundColor(0);
    mXWalkView.load("http://www.baidu.com/", null);
  }

But the setZOrderOnTop() function doesn't exist in mXWalkView class.

ks32 commented 1 year ago

yes it will not work. You can set background color from html/css in xwalkview.

maxiannunziata commented 1 year ago

@ks32 I tried with set transparent in HTML/CSS but the SurfaceView inside xwalkview is white and the exoplayer above the xwalkview don't show.

Can you add the setZOrderOnTop() class in the mXWalkView?