[TIMOB-26693] Android status bar colour
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | alloy, android, feature, parity |
Reporter | Luke Fisk-Lennon |
Assignee | Eric Merriman |
Created | 2019-01-05T00:57:39.000+0000 |
Updated | 2019-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!
You have to use a Theme to do this. Please follow the guide at https://docs.appcelerator.com/platform/latest/#!/guide/Android_Themes
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.
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 setToolbar
property "extendBackground" totrue
. This will extend theToolbar
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 youTabGroups
. https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Toolbar-property-extendBackground