Ok, I found the problem, confusion was due to some misleading documentation.

@ https://crosswalk-project.org/apis/embeddingapidocs_v3/org/xwalk/core/XWalkView.html "Since it internally uses android.view.SurfaceView for rendering web pages by default"

Is incorrect. It should now be TextureView.

Why? Because ANIMATABLE_XWALK_VIEW, by default, is set to TRUE, which makes it TextureView.

Because of that error, I thought I started with SurfaceView, thus I was confused why ANIMATABLE_XWALK_VIEW(false) would not net the same result.

So I put in a proper SurfaceView for XWalkView, with ANIMATABLE_XWALK_VIEW(false), and it works now.

Sorry!

On 2015-05-20 14:03, timliu wrote:
Sorry, somehow my question seems lost in translation.

@
https://crosswalk-project.org/apis/embeddingapidocs_v3/org/xwalk/core/XWalkPreferences.html#ANIMATABLE_XWALK_VIEW

I want XWalkView to use SurfaceView.

(I know that by default, it already does, "Since it internally uses
android.view.SurfaceView for rendering web pages by default")

My issue is #ANIMATABLE_XWALK_VIEW: "Default value is true. ...  If
this key is set to True, ... Internally, Crosswalk is alternatively
using TextureView as the backend of XWalkView."

Therefore, if I wanted to manually set to SurfaceView, my direction
should be: "If this key is set to False, then SurfaceView will be
created internally as the rendering backend."

Ok! So to set it to SurfaceView, I do:
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, false);

However! Why does it make this view transparent? I don't want it transparent.

xWalkWebView.setAlpha((float) 1.0) <-- still transparent
xWalkView.setBackgroundColor(Color.BLACK) <-- still transparent

If I leave out that setValue line, then it's fine. What is the
difference? What changed?

Thanks!
-Tim

On 2015-05-19 17:29, Xu, Xing wrote:
Hi, Tim,  Thanks for your feedback.

"The inside of XWalkView is a SurfaceView( If ANIMATABLE_XWALK_VIEW is
true) or TextureView( If ANIMATABLE_XWALK_VIEW is false)."
************************************************************
==> I have edit this description. Please check it.


2. My other issue is the *Transparency* that happens when I set
ANIMATABLE_XWALK_VIEW to FALSE. I do not know why that is supposed to
happen. If I leave out that XWalkPreferences.setValue line, then it
shows up fine.
************************************************************
==>For transparency, better check with
https://crosswalk-project.org/jira/browse/XWALK-3308.
XWALK-3742 is for XWalkView overlay with MapView.
BTW, you need to do these to enable transparent:
1), Set ANIMATABLE_XWALK_VIEW to false, this only works for SurfaceView.
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW,
false);
2), Apply tranparent theme in AndroidManifest.xml
android:theme="@android:style/Theme.Translucent.NoTitleBar"
3), Call xWalkView.setBackgroundColor(Color.TRANSPARENT);


Regards,
XIng

-----Original Message-----
From: Crosswalk-help
[mailto:[email protected]] On Behalf
Of timliu
Sent: Wednesday, May 20, 2015 3:56 AM
To: [email protected]
Subject: [Crosswalk-help] ANIMATABLE_XWALK_VIEW wording, transparency, ...?

I am a bit confused by ANIMATABLE_XWALK_VIEW:

1. I am interested in using SurfaceView instead of TextureView for
XWalkView... because SurfaceView consumes less resource.

Multiple sources state that FALSE will switch to SurfaceView:
@
https://github.com/crosswalk-project/crosswalk-website/wiki/Android-SurfaceView-vs-TextureView
@
https://crosswalk-project.org/apis/embeddingapidocs_v3/org/xwalk/core/XWalkPreferences.html

Yet, another source says opposite:
@
https://crosswalk-project.org/jira/si/jira.issueviews:issue-html/XWALK-3742/XWALK-3742.html
"The inside of XWalkView is a SurfaceView( If ANIMATABLE_XWALK_VIEW is
true) or TextureView( If ANIMATABLE_XWALK_VIEW is false)."

Anyways, I'm sure setting FALSE is correct...

2. My other issue is the *Transparency* that happens when I set
ANIMATABLE_XWALK_VIEW to FALSE. I do not know why that is supposed to
happen. If I leave out that XWalkPreferences.setValue line, then it
shows up fine.

Here is my code:
**************************************
if (xWalkWebView == null) {
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW,
false);
xWalkWebView = new XWalkView(this, MyActivity.this); }

xWalkWebView.load(myUrl, null);

if (android.os.Build.VERSION.SDK_INT >=
android.os.Build.VERSION_CODES.HONEYCOMB) {
((LinearLayout)
findViewById(R.id.topVWin_holder)).setLayerType(View.LAYER_TYPE_HARDWARE,
null);
xWalkWebView.setLayerType(View.LAYER_TYPE_HARDWARE, null); }

((LinearLayout)
findViewById(R.id.topVWin_holder)).addView(xWalkWebView);
((LinearLayout)
findViewById(R.id.topVWin_holder)).bringChildToFront(xWalkWebView);
xWalkWebView.bringToFront();
xWalkWebView.setAlpha((float) 1.0);
**************************************

I thought it was my LinearLayout holder hiding behind something or
that I needed to re-set Alpha back to 1.0, but no effect.

I am using the latest version 12.41.x

Thanks!
-Tim

P.S. Does this line work with crosswalk?
xWalkWebView.setLayerType(View.LAYER_TYPE_HARDWARE, null)

xWalkWebView.isHardwareAccelerated() shows TRUE but
xWalkWebView.getLayerType() shows 0 (=LAYER_TYPE_NONE)
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to