Bug 26247 - The color of the status bar does not change when android:statusBarColor or android:colorPrimaryDark is set.
Summary: The color of the status bar does not change when android:statusBarColor or an...
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: PC Windows
: High normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2015-01-21 13:21 UTC by JEstes
Modified: 2016-01-28 08:16 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

Test Case (12.78 KB, application/zip)
2015-06-10 12:22 UTC, John Miller [MSFT]
port of the test case provided (239.69 KB, application/zip)
2015-06-26 11:44 UTC, Ben Beckley

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 26247 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description JEstes 2015-01-21 13:21:04 UTC
According to the documentation, android:statusBarColor or android:colorPrimaryDark should change the color of the status bar on Android 5.0 devices.  I have both of these properties set in a theme that inherits from android:Theme.Material.Light.DarkActionBar. 

Below is the contents of my Styles.xml file in the values-v21 folder.  The first 3 items change the colors as expected.  But the last 2 seem to have no impact.  I have not tried to change the Navigation Bar color, so I don't know if that works or not.

  <style name="ItronMobileTheme" parent="android:Theme.Material.Light.DarkActionBar">
    <item name="android:colorPrimary">@color/ItronBlue</item>
    <item name="android:colorAccent">@color/ItronYellow</item>
    <item name="android:windowBackground">@color/White</item>
    <item name="android:colorPrimaryDark">@color/ItronBlueDark</item>
    <item name="android:statusBarColor">@color/ItronBlueDark</item>
Comment 1 John Miller [MSFT] 2015-06-10 12:21:43 UTC
I have been able to reproduce this when building with XA 5.1. 

Downgrading to XA 4.20 produces the expected results and works.
Comment 2 John Miller [MSFT] 2015-06-10 12:22:48 UTC
Created attachment 11546 [details]
Test Case

Attached a sample. 

To Reproduce:

1. Run on an API 21 device with XA 5.1 installed. 

To see expected behavior:

1. Downgrade to XA 4.20, rebuild app, and run on an API 21 device.
Comment 3 Jonathan Pryor 2015-06-10 15:05:38 UTC
Dean: This is probably resource-related... :-(
Comment 4 Ben Beckley 2015-06-25 17:38:35 UTC
I checked out the latest beta build for XA ( and found that all attributes can be changed except for colorPrimaryDark. Though, this happens to be the same behavior that a ported native version of the sample had as well. In other words, colorPrimaryDark is not being altered when using a native Java Android app - it is the same between both the XA and native app.

This device used for testing was a Samsung Galaxy S5 (5.0).

env : https://gist.github.com/BenBeckley/2a41477badafd39ee8d0
Comment 5 Ben Beckley 2015-06-26 11:44:02 UTC
Created attachment 11752 [details]
port of the test case provided

For those interested in trying out the native app.

Also, here is a reference as to what these values should be changing: https://developer.android.com/training/material/theme.html#StatusBar
Comment 6 Rajneesh Kumar 2015-07-01 12:03:53 UTC
I have checked this issue and I am also able to reproduce this. To reproduce this issue I have followed the steps and instruction provided in comment 2.

I observed that the color of the status bar does not change with XA  and it works(Change) with XA

Screencast: http://www.screencast.com/t/ThLvcwXm9

Ide Logs: https://gist.github.com/Rajneesh360Logica/39760d3df772e01f88c0
Device logs: https://gist.github.com/Rajneesh360Logica/0a7cd2abc8295b0a3acc
Application Output: https://gist.github.com/Rajneesh360Logica/6887ed0c0b529f37c358
Build Output: https://gist.github.com/Rajneesh360Logica/51fd88d62d5ceabf5e38

Environment Info:

=== Xamarin Studio ===

Version 5.9.4 (build 5)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
	Mono 4.0.2 ((detached/c99aa0c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400020005

=== Xamarin.Android ===

Version: (Starter Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: (Starter Edition)
Hash: ff5adaa
Branch: master
Build date: 2015-06-30 11:17:03-0400

=== Xamarin.Mac ===

Version: (Starter Edition)

=== Build Information ===

Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64