Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26693] Android status bar colour

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsalloy, android, feature, parity
ReporterLuke Fisk-Lennon
AssigneeEric Merriman
Created2019-01-05T00:57:39.000+0000
Updated2019-01-07T19:08:13.000+0000

Description

I've been looking through the documentation but can't seem to find a way to set the status bar's colour on Android. Is this feature going to be added in the future? Are they any workarounds for the moment? Thanks!

Comments

  1. Michael Gangolf 2019-01-06

    You have to use a Theme to do this. Please follow the guide at https://docs.appcelerator.com/platform/latest/#!/guide/Android_Themes
  2. Sharif AbuDarda 2019-01-07

    Hello, Thanks for the ticket. Currently, there is no way to do styling statusbar in Android. This will be a nice feature added to the platform in future updates. Our engineers will look into it. Currently, we have a lot in our pipeline, so implementing this will take time. Thanks.
  3. Joshua Quick 2019-01-07

    Doing it via a theme as [~michael] suggested is the best solution. That is typically how a native Android app developer would do it as well. This is also the simplest solution. Have a look at our "kitchensink-v2" example app. It uses a custom theme XML file. Its "colorPrimary" setting sets the main color for the top status bar, top action bar, and bottom navigation bar. https://github.com/appcelerator/kitchensink-v2/blob/master/app/platform/android/res/values/custom_theme.xml Alternatively, you can remove the top title bar via "Theme.AppCompat.NoTitleBar", use Titanium's Toolbar as the title bar instead, and then set Toolbar property "extendBackground" to true. This will extend the Toolbar underneath the top status bar (so that the status bar overlaps the toolbar) and you can then apply whatever color you want to the toolbar. Just note that this is not a viable solution if you TabGroups. https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Toolbar-property-extendBackground

JSON Source