Hi, Lundin,
There are two backgrounds: Android window background and XWalkView background.
When a XWalkView view loaded, first show Android window background then 
XWalkView background.

If you want to change the XWalkView background. There are two methods:
First and the suggested way, set the background with css:
//*************************Code Start************************* 
body { background: #ff0000 fixed center; } 
//*************************Code End*************************

Second, and with poor performance:  mXWalkView.setBackgroundColor(0); I have 
submitted a fix for bug 1910(under review).  
With this patch, you can only set the background color to black(0); Other color 
cannot be set, I am still investigate it.


If you want to change the Android window background,  you can apply a custom 
theme as below:
1),  AndroidManifest.xml
//*************************Code Start*************************
14         <activity 
android:name="org.xwalk.core.xwview.shell.XWalkViewShellActivity"
 15             android:theme="@style/AppTheme"
 16             
android:configChanges="orientation|keyboardHidden|keyboard|screenSize"
 17             android:label="XWalkCoreShell">
 18           <intent-filter>
 19             <action android:name="android.intent.action.MAIN" />
 20             <category android:name="android.intent.category.LAUNCHER" />
 21           </intent-filter>
 22         </activity>
//*************************Code End************************* 
2), Create res/values-v17/theme.xml and provides related drawables:
//*************************Code Start*************************
  1 <?xml version="1.0" encoding="utf-8"?><!--
  2 Copyright (c) 2014 Intel Corporation. All rights reserved.
  3 Use of this source code is governed by a BSD-style license that can be
  4 found in the LICENSE file.
  5 --><resources>
  6     <!-- Application theme. -->
  7     <style name="AppTheme" 
parent="@android:style/Theme.Holo.Light.NoActionBar">
  8         <item name="android:windowFullscreen">false</item>
  9         <item name="android:windowBackground">@drawable/window_bg</item>
 10     </style>
 11 </resources>
//*************************Code End*************************

-----Original Message-----
From: Jonatan Lundin [mailto:[email protected]]
Sent: Sunday, February 1, 2015 1:59 AM
To: Xu, Xing
Subject: Re: [Crosswalk-help] Support for transparent backgrounds

Hello Xu,
That’s great news! Thank you for making this a priority.

Have a nice weekend,
Jonatan Lundin

> On 31 jan 2015, at 11:36, Xu, Xing <[email protected]> wrote:
> 
> Hi, Lundin,
> Thanks for your interests in crosswalk project and your information for this 
> issue.
> We will give priority to  this problem  since next Monday and fix it asap. 
> After reproduce and tests, we will give ETA of this issue.
> 
> Sorry for this inconvenience.
> 
> 
> -----Original Message-----
> From: Crosswalk-help 
> [mailto:[email protected]] On Behalf 
> Of Jonatan Lundin
> Sent: Friday, January 30, 2015 11:19 PM
> To: [email protected]
> Subject: [Crosswalk-help] Support for transparent backgrounds
> 
> Hi all,
> I’ve spend the last few days migrating a larger hybrid app to XWalk, and I’m 
> very happy with the general performance improvements as well as the increased 
> stability and standards support I’ve seen. 
> 
> I’ve run into some trouble though. A few months back there were some 
> discussion about issues with transparent backgrounds, since then it has been 
> rather silent. These issues are still very much present though. Have you been 
> making any progress with addressing them?
> 
> This JIRA ticket seems highly relevant, but there hasn’t been any major 
> action in the last 5 months:
> https://crosswalk-project.org/jira/browse/XWALK-1910
> 
> As mentioned in other places, there has been a fix for this in the standard 
> Android WebView since long:
> https://code.google.com/p/chromium/issues/detail?id=391462
> 
> This is a fairly critical issue for my organization, so any help and/or 
> updates would be more than welcome!
> 
> Sincerely,
> Jonatan Lundin
> _______________________________________________
> 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