[ 
https://issues.apache.org/jira/browse/CB-11836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15509537#comment-15509537
 ] 

ASF GitHub Bot commented on CB-11836:
-------------------------------------

Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-windows/pull/195#discussion_r79804658
  
    --- Diff: spec/unit/AppxManifest.spec.js ---
    @@ -187,6 +187,27 @@ describe('AppxManifest', function () {
             it('refineColor should leave CSS color name as is', function () {
                 expect(refineColor(CSS_COLOR_NAME)).toEqual(CSS_COLOR_NAME);
             });
    +        
    +        it('setForegroundText should change the ForegroundText property on 
non-Windows 10 platforms', function () {
    +            var visualElementsWindows = 
AppxManifest.get(WINDOWS_MANIFEST).getVisualElements();
    +            var visualElementsWindows10 = 
AppxManifest.get(WINDOWS_10_MANIFEST).getVisualElements();
    +            
    +            var foregroundTextLight = 'light';
    +            var foregroundTextDark = 'dark';
    +            
    +            // Set to 'light'
    +            visualElementsWindows.setForegroundText(foregroundTextLight);
    +            
expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextLight);
    +            
    +            // Set to 'dark'
    +            visualElementsWindows.setForegroundText(foregroundTextDark);
    +            
expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextDark);
    +            
    --- End diff --
    
    It also would be good to add a case for missing preference:
    ```javascript
                // Simulate the absence of preference, should default to 'light'
                visualElementsWindows.setForegroundText(undefined);
                
expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextLight);
    ```


> BackgroundColor cannot be set to white
> --------------------------------------
>
>                 Key: CB-11836
>                 URL: https://issues.apache.org/jira/browse/CB-11836
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Windows
>         Environment: Visual Studio 2015 Update 3, Apache Cordova 6.3.1, 
> cordova-windows 4.4.2
>            Reporter: Steffen Schaffert
>
> Recently, we tried to release an app version to the Windows Store (targeting 
> both Mobile and Desktop platforms)  with the BackgroundColor preference in 
> config.xml set to white (see below). 
> The build succeeded, but after submitting the app in the Windows Store, the 
> submission was declined as non-compliant, the reason being a low contrast 
> between background and foreground color. After some research, we discovered 
> the property "ForegroundText", which can be "light" or "dark", and which is 
> set to "light" per default in a Windows app. After changing this property 
> (which did not have a visible impact on our app, as we are using an image for 
> icon and splashscreen), the submission was successful. 
> As a more permanent solution, I added the functionality to change the 
> ForegroundText preference, similar to BackgroundColor, in the config.xml 
> file. I submitted this as a Pull Request 
> (https://github.com/apache/cordova-windows/pull/195).
> If there is a different solution to this problem, I would be glad to hear it, 
> otherwise I hope that the pull request can be used as a fix.
> Setting in config.xml which caused problems:
> {quote}
> <platform name="windows">
>     <preference name="BackgroundColor" value="#ffffff"/>
> </platform>
> {quote}
> Solution with fix applied:
> {quote}
> <platform name="windows">
>     <preference name="BackgroundColor" value="#ffffff"/>
>     <preference name="ForegroundText" value="dark"/>
> </platform>
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to