You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by EddyVerbruggen <gi...@git.apache.org> on 2015/02/27 10:32:48 UTC

[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

GitHub user EddyVerbruggen opened a pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22

    Allow setting the statusbar backgroundcolor on Android

    Since Android Lollipop the statusbar of your app is no longer black. On a Samsung Galaxy S5 my mostly white app now has a blue statusbar. This change gives control back to your app.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/EddyVerbruggen/cordova-plugin-statusbar master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-statusbar/pull/22.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #22
    
----
commit 43c8c15bf48d058fec9e91a6d2bcad17880b2b78
Author: EddyVerbruggen <ed...@gmail.com>
Date:   2015-02-27T09:29:39Z

    Allow setting the statusbar backgroundcolor on Android

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by dpogue <gi...@git.apache.org>.
Github user dpogue commented on the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#issuecomment-76508631
  
    Rather than more config.xml preferences, might it be better to set the statusBar colour on all platforms based on the `<meta name="theme-color">` tag as per the WHATWG spec?
    
    https://github.com/whatwg/meta-theme-color


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by EddyVerbruggen <gi...@git.apache.org>.
Github user EddyVerbruggen commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#discussion_r25538963
  
    --- Diff: doc/index.md ---
    @@ -41,6 +41,10 @@ Preferences
     
             <preference name="StatusBarBackgroundColor" value="#000000" />
     
    +- __AndroidStatusBarBackgroundColor__ (color hex string, defaults to the Android theme default). On Android 5 and up, the background color can be set by a hex string (#RRGGBB) at startup. We don't use the same property as for iOS because on iOS you typically want the statusbar to have the same color as the app background, but the Android 5+ guidelines specify using a different color than you apps main color, so the value of this property is typically different than the one specified by StatusBarBackgroundColor.
    --- End diff --
    
    @sinofool how would you do that? AFAIK a preference doesn't have a platform attribute.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by sinofool <gi...@git.apache.org>.
Github user sinofool commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#discussion_r25553628
  
    --- Diff: doc/index.md ---
    @@ -41,6 +41,10 @@ Preferences
     
             <preference name="StatusBarBackgroundColor" value="#000000" />
     
    +- __AndroidStatusBarBackgroundColor__ (color hex string, defaults to the Android theme default). On Android 5 and up, the background color can be set by a hex string (#RRGGBB) at startup. We don't use the same property as for iOS because on iOS you typically want the statusbar to have the same color as the app background, but the Android 5+ guidelines specify using a different color than you apps main color, so the value of this property is typically different than the one specified by StatusBarBackgroundColor.
    --- End diff --
    
    @EddyVerbruggen Like this?
    <preference name="Fullscreen" value="false" />
    <preference name="Orientation" value="portrait" />
    <platform name="ios">
        <preference name="BackupWebStorage" value="none" />
        <preference name="UIWebViewDecelerationSpeed" value="fast" />
        <preference name="StatusBarOverlaysWebView" value="false" />
        <preference name="StatusBarStyle" value="lightcontent" />
        <preference name="StatusBarBackgroundColor" value="#000000" />
    </platform>
    <platform name="android">
        <preference name="StatusBarBackgroundColor" value="#00FF00" />
    </platform>


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by EddyVerbruggen <gi...@git.apache.org>.
Github user EddyVerbruggen commented on the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#issuecomment-76476575
  
    Hi @purplecabbage thanks for the quick review!
    
    I've now added runtime support for `backgroundColorByHexString` as you suggested (including of course support for `backgroundColorByName`).
    
    Do I correctly understand your standpoint that you will accept the PR if I change the usage of `AndroidStatusBarBackgroundColor` to the existing `StatusBarBackgroundColor`? Including a readme quirck about the Android guideline and how to fix it at runtime if you want to adhere to it?
    
    Thanks,
    Eddy


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by sinofool <gi...@git.apache.org>.
Github user sinofool commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#discussion_r25564799
  
    --- Diff: doc/index.md ---
    @@ -41,6 +41,10 @@ Preferences
     
             <preference name="StatusBarBackgroundColor" value="#000000" />
     
    +- __AndroidStatusBarBackgroundColor__ (color hex string, defaults to the Android theme default). On Android 5 and up, the background color can be set by a hex string (#RRGGBB) at startup. We don't use the same property as for iOS because on iOS you typically want the statusbar to have the same color as the app background, but the Android 5+ guidelines specify using a different color than you apps main color, so the value of this property is typically different than the one specified by StatusBarBackgroundColor.
    --- End diff --
    
    That's  interesting, I thought it is a basic feature of perference component, like the merge diectory. I have an app depends on this to work.
    Let me double check and come back later.
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by EddyVerbruggen <gi...@git.apache.org>.
Github user EddyVerbruggen commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#discussion_r25555210
  
    --- Diff: doc/index.md ---
    @@ -41,6 +41,10 @@ Preferences
     
             <preference name="StatusBarBackgroundColor" value="#000000" />
     
    +- __AndroidStatusBarBackgroundColor__ (color hex string, defaults to the Android theme default). On Android 5 and up, the background color can be set by a hex string (#RRGGBB) at startup. We don't use the same property as for iOS because on iOS you typically want the statusbar to have the same color as the app background, but the Android 5+ guidelines specify using a different color than you apps main color, so the value of this property is typically different than the one specified by StatusBarBackgroundColor.
    --- End diff --
    
    @sinofool That would be a great addition to the spec, but unfortunately that's not how it seems to work. The platform ignores the `platform` tag and simply picks up the last value of a preference you specify.
    
    So this:
    
    ```xml
        <platform name="android">
            <preference name="StatusBarBackgroundColor" value="#444444" />
        </platform>
    
        <platform name="ios">
            <preference name="StatusBarBackgroundColor" value="#cccccc" />
        </platform>
    ```
    
    means `#cccccc` is applied to all platforms.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by EddyVerbruggen <gi...@git.apache.org>.
Github user EddyVerbruggen commented on the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#issuecomment-76516415
  
    @purplecabbage Here you go, thanks for the pointers and hope you like it.
    
    Re transparency: from what I've read it depends on the theme your app uses. Looking at [these screenshots](https://github.com/jgilfelt/SystemBarTint) there should be ways to have content scroll behind it, but I don't think that's the default.
    
    Best,
    Eddy


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#issuecomment-77080082
  
    Nicely done!
    ![screen shot 2015-03-03 at 5 26 46 pm](https://cloud.githubusercontent.com/assets/46134/6476477/0e43b846-c1cb-11e4-94a5-f47c77f80bc0.png)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by sinofool <gi...@git.apache.org>.
Github user sinofool commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#discussion_r25529377
  
    --- Diff: doc/index.md ---
    @@ -41,6 +41,10 @@ Preferences
     
             <preference name="StatusBarBackgroundColor" value="#000000" />
     
    +- __AndroidStatusBarBackgroundColor__ (color hex string, defaults to the Android theme default). On Android 5 and up, the background color can be set by a hex string (#RRGGBB) at startup. We don't use the same property as for iOS because on iOS you typically want the statusbar to have the same color as the app background, but the Android 5+ guidelines specify using a different color than you apps main color, so the value of this property is typically different than the one specified by StatusBarBackgroundColor.
    --- End diff --
    
    How about using platform specific configuration in config.xml?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by djdmbrwsk <gi...@git.apache.org>.
Github user djdmbrwsk commented on the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#issuecomment-76509417
  
    Really looking forward to this!  Setting the color at runtime is key for Android 5 because more and more apps have different colors for each layer.  Ex. [Google's Messenger](https://play.google.com/store/apps/details?id=com.google.android.apps.messaging&hl=en)
    
    @purplecabbage The statusbar can be transparent, but that's usually only seen on the lock screen and home screen or when viewing a picture/video.  I don't think i've ever seen it as you described.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-statusbar/pull/22


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#issuecomment-76453675
  
    This should be identical to the other platforms.
    Documentation should specify the 'quirk' in how the Android guidelines recommend it's usage.
    
    Actually setting a different value is a job for the app developer.
    ```
    if(cordova.platformId == 'android') {
        StatusBar.backgroundColorByHexString("#333");
    }
    ```
    
    Also, this pull request is missing most of the functionality of the plugin.  This property should be changeable at runtime like wp8.1|wp8|ios.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-statusbar pull request: Allow setting the statusbar...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-plugin-statusbar/pull/22#issuecomment-76480150
  
    Yes, that is correct.
    Also, [1] in js takes care of making sure you get a valid #RRGGBB even if it is passed 'RGB'
    and ColorByName simply calls this method.
    
    Just out of curiousity, is it possible to have a semi transparent status bar on Android? and if so, does page content scroll behind it?
    
    [1] https://github.com/apache/cordova-plugin-statusbar/blob/master/www/statusbar.js#L73



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org