I have tried for several days to fix a problem where multiple of my UI elements in my toolbar is the wrong color. If you take a look at the picture below you can see what I mean:
Elements that should be white are black and I just can't figure out how to fix this through my theme.
Here's my themes.xml (sry about the mess in there, but theming is really difficult):
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.GuidelinesCompat.Light.DarkToolbar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:windowBackground">#color/colorBackground</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowActionModeOverlay">true</item>
<item name="toolbarStyle">#style/AppTheme.NoActionBar.ToolbarStyle</item>
<item name="actionModeStyle">#style/AppTheme.NoActionBar.ActionModeStyle</item>
<item name="searchViewStyle">#style/AppTheme.NoActionBar.SearchViewStyle</item>
<!--<item name="android:actionModeBackground">#color/bg_action_mode</item>-->
<!--<item name="android:textColorSecondary">#color/white</item>-->
</style>
<style name="AppTheme.ActionBar">
<item name="android:windowActionModeOverlay">true</item>
</style>
<!-- Base toolbar theme. -->
<style name="AppTheme.NoActionBar.ToolbarStyle" parent="Widget.GuidelinesCompat.Toolbar">
<item name="titleTextAppearance">#style/AppTheme.NoActionBar.ToolbarTitleTextAppearance</item>
</style>
<style name="AppTheme.NoActionBar.ToolbarTitleTextAppearance" parent="#style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textColor">#color/white</item>
<item name="android:textColorSecondary">#color/white</item>
</style>
<!-- Base Action Mode styles -->
<style name="AppTheme.NoActionBar.ActionModeStyle" parent="Widget.GuidelinesCompat.ActionMode">
<item name="background">#color/bg_action_mode</item>
<!--<item name="android:actionModeBackground">#color/bg_action_mode</item>-->
<!--<item name="android:actionOverflowButtonStyle">#style/ActionModeTitleTextStyle</item>-->
<!--<item name="statusBarColor">#color/grey_100</item>-->
</style>
<style name="ActionModeTitleTextStyle" parent="Widget.GuidelinesCompat.ActionButton.Overflow">
<item name="android:textColor">#color/white</item>
<item name="android:textColorSecondary">#color/white</item>
</style>
<style name="AppTheme.NoActionBar.SearchViewStyle" parent="Widget.AppCompat.SearchView">
<!-- Sets the search icon -->
<item name="searchIcon">#drawable/ic_search_white_24dp</item>
<!-- Gets rid of the "underline" in the text -->
<!--<item name="queryBackground">#color/white</item>-->
<!-- Gets rid of the search icon when the SearchView is expanded -->
<!--<item name="searchHintIcon">#null</item>-->
<!-- The hint text that appears when the user has not typed anything -->
<!--<item name="queryHint">#string/menu_examination_search_hint</item>-->
<item name="android:textAppearance">#style/SearchViewTextAppearance</item>
</style>
<style name="SearchViewTextAppearance">
<item name="android:textColorHint">#color/white</item>
<item name="android:textColor">#color/white</item>
<item name="android:textColorSecondary">#color/white</item>
</style>
<!-- Theme applied to LoginActivity and SignUpActivity -->
<style name="AppTheme.Login" parent="AppTheme.NoActionBar">
<item name="android:windowBackground">#color/colorPrimary</item>
<item name="android:textColorHint">#color/iron</item>
<item name="android:textColorPrimary">#color/white</item>
<item name="colorControlNormal">#color/iron</item>
<item name="colorControlActivated">#color/white</item>
<item name="colorControlHighlight">#color/white</item>
<item name="colorButtonNormal">#color/colorPrimaryDarker</item>
</style>
<style name="AppTheme.NavigationView">
<item name="android:textColorSecondary">#color/colorTextSecondary</item>
</style>
<!-- Theme applied to Textview in LoginActivity and SignUpActivity -->
<style name="WhiteText" parent="#android:style/TextAppearance">
<item name="android:textColor">#color/white</item>
</style>
<!-- Animations applied to dialog when entering or exiting -->
<style name="DialogAnimation">
<item name="android:windowEnterAnimation">#anim/slide_up</item>
<item name="android:windowExitAnimation">#anim/slide_down</item>
</style>
I've found out that if I set textColorSecondary in my AppTheme.NoActonBar all my controls are correctly coloured white, but this gives me trouble in all my dialogs, that now also have textColorSecondary set to white.
I hope someone out there can show me a solution, cause I'm out of ideas.
Try this here .
In your toolbar layout:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
app:theme="#style/ToolBarStyle"
app:popupTheme="#style/ToolBarPopupStyle"
android:background="#color/actionbar/>
In your styles:
<!-- ToolBar -->
<style name="ToolBarStyle" parent="Theme.AppCompat">
<item name="android:textColorPrimary">#android:color/white</item>
<item name="android:textColorSecondary">#android:color/white</item>
<item name="actionMenuTextColor">#android:color/white</item>
<item name="actionOverflowButtonStyle">#style/ActionButtonOverflowStyle</item>
<item name="drawerArrowStyle">#style/DrawerArrowStyle</item>
</style>
Related
im using Material IO and i want to Change the Text-Color of my Menu.
<resources>
...
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
...
<item name="android:textColorPrimary">#color/colorText</item>
</style>
...
<resources>
Does exactly that. But it changes every Text Color. But i just want to Change the Color of my Menu-Text.
So i tried to change only that:
<style name="ActionBarTheme" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:textColor">#color/colorMenuText</item> //android.view
<item name="android:textColorPrimary">#color/colorMenuText</item>
<item name="android:actionMenuTextAppearance">#color/colorWhite</item>
<item name="android:background">#color/colorAccent</item>
<item name="popupTheme">#style/ActionBarPopupTheme</item>
<!-- backward compatibility -->
<item name="background">#color/colorAccent</item>
</style>
by writing some Thing like This.
I can change the Menu-Background this way, but i cant change the Menu-Text-Color this way. I tried everything i found on Stackoverflow but i couldnt fix this issue.
Whole Styles.xml
<resources>
<style name="ActionBarTheme" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:textColor">#color/colorMenuText</item> //android.view
<item name="android:textColorPrimary">#color/colorMenuText</item>
<item name="android:actionMenuTextAppearance">#color/colorWhite</item>
<item name="android:background">#color/colorAccent</item>
<item name="popupTheme">#style/ActionBarPopupTheme</item>
<!-- backward compatibility -->
<item name="background">#color/colorAccent</item>
</style>
<style name="AlertDialogCustom" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:colorAccent">#0000FF</item>
</style>
<style name="ActionBarPopupTheme">
<item name="android:textColor">#color/colorMenuText</item>
<item name="android:background">#color/colorMenuBackground</item>
</style>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<!-- MENU -->
<item name="android:actionBarStyle">#style/ActionBarTheme</item>
<item name="actionBarStyle">#style/ActionBarTheme</item>
<!-- DIALOG -->
<item name="md_color_title">#color/colorPrimary</item>
<item name="md_color_content">#color/colorPrimaryDark</item>
<item name="md_color_button_text">#color/colorAccent</item>
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorTest2</item>
<item name="colorPrimaryDark">#color/colorTest3</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:actionMenuTextColor">#color/colorMenuText</item>
<item name="android:textColor">#color/colorWhite</item>
<item name="color">#color/colorTest4</item>
<item name="colorSecondary">#FF0000</item>
<item name="android:colorBackground">#color/colorBackground</item>
<item name="colorError">#color/colorError</item>
<item name="colorPrimaryVariant">#color/colorAccent</item>
<item name="colorSecondaryVariant">#color/colorTest</item>
<item name="colorSurface">#313131</item>
<item name="colorOnPrimary">#00BCD4</item>
<item name="colorOnSecondary">#00BCD4</item>
<item name="colorOnBackground">#673AB7</item>
<item name="colorOnError">#2196F3</item>
<item name="colorOnSurface">#color/colorOnAccent</item> <!-- placeholder farbe -->
<item name="scrimBackground">#E607FF</item>
<item name="android:editTextColor">#color/colorText</item>
<item name="android:textColorPrimary">#color/colorText</item>
<item name="android:textColorSecondary">#color/colorText</item>
<item name="android:textColorTertiary">#color/colorText</item>
<item name="android:textColorPrimaryInverse">#color/colorText</item>
<item name="android:textColorSecondaryInverse">#color/colorText</item>
<item name="android:textColorTertiaryInverse">#color/colorText</item>
</style>
<style name="MyTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyTheme.ActionBarStyle</item>
</style>
<style name="MyTheme.ActionBarStyle" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:titleTextStyle">#style/MyTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="MyTheme.ActionBar.TitleTextStyle" parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/colorMenuText</item>
</style>
<style name="Theme.MyApp" parent="Theme.AppCompat">
<!-- DIALOG -->
<item name="md_color_title">#color/colorPrimary</item>
<item name="md_color_content">#color/colorPrimaryDark</item>
<item name="md_color_button_text">#color/colorAccent</item>
<!-- Original AppCompat attributes. -->
<item name="colorPrimary">#color/colorTest4</item>
<item name="colorSecondary">#color/colorTest5</item>
<item name="android:colorBackground">#color/colorBackground</item>
<item name="colorError">#color/colorError</item>
<!-- New MaterialComponents attributes. -->
<item name="colorPrimaryVariant">#color/colorAccent</item>
<item name="colorSecondaryVariant">#color/colorTest</item>
<item name="colorSurface">#313131</item>
<item name="colorOnPrimary">#9C27B0</item>
<item name="colorOnSecondary">#00BCD4</item>
<item name="colorOnBackground">#673AB7</item>
<item name="colorOnError">#2196F3</item>
<item name="colorOnSurface">#E91E63</item>
<item name="scrimBackground">#FFC107</item>
<item name="textAppearanceHeadline1">#style/TextAppearance.MaterialComponents.Headline1</item>
<item name="textAppearanceHeadline2">#style/TextAppearance.MaterialComponents.Headline2</item>
<item name="textAppearanceHeadline3">#style/TextAppearance.MaterialComponents.Headline3</item>
<item name="textAppearanceHeadline4">#style/TextAppearance.MaterialComponents.Headline4</item>
<item name="textAppearanceHeadline5">#style/TextAppearance.MaterialComponents.Headline5</item>
<item name="textAppearanceHeadline6">#style/TextAppearance.MaterialComponents.Headline6</item>
<item name="textAppearanceSubtitle1">#style/TextAppearance.MaterialComponents.Subtitle1</item>
<item name="textAppearanceSubtitle2">#style/TextAppearance.MaterialComponents.Subtitle2</item>
<item name="textAppearanceBody1">#style/TextAppearance.MaterialComponents.Body1</item>
<item name="textAppearanceBody2">#style/TextAppearance.MaterialComponents.Body2</item>
<item name="textAppearanceCaption">#style/TextAppearance.MaterialComponents.Caption</item>
<item name="textAppearanceButton">#style/TextAppearance.MaterialComponents.Button</item>
<item name="textAppearanceOverline">#style/TextAppearance.MaterialComponents.Overline</item>
</style>
</resources>
I tried this minimum sample of your code and it gives me the desired behavior
I think there is a conflict with your styles
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="actionBarTheme">#style/ActionBarTheme</item>
</style>
<style name="ActionBarTheme" parent="#style/ThemeOverlay.MaterialComponents.ActionBar">
<item name="android:textColorPrimary">#ffffff</item>//for title text color
<item name="colorPrimary">#D81B60</item>// for toolbar background
<item name="popupTheme">#style/ActionBarPopupTheme</item>
</style>
<style name="ActionBarPopupTheme">
<item name="android:textColor">#304FFE</item> // for option menu text color
</style>
On my main app theme I have:
<item name="android:popupMenuStyle">#style/MyApp.PopupMenu</item>
<item name="android:textAppearanceLargePopupMenu">#style/MyTextAppearanceLargePopupMenu
</item>
<item name="android:textAppearanceSmallPopupMenu">#style/MyTextAppearanceSmallPopupMenu
</item>
And then I have
<style name="MyApp.PopupMenu" parent="Base.Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">#color/white</item>
<item name="android:textColorPrimary">#color/black</item>
<item name="android:textColorSecondary">#color/black</item>
<item name="android:textColor">#color/black</item>
<item name="android:background">#color/color_white</item>
<item name="overlapAnchor">true</item>
<item name="android:overlapAnchor">true</item>
<item name="android:textAppearanceLargePopupMenu">#style/MyTextAppearanceLargePopupMenu
</item>
<item name="android:textAppearanceSmallPopupMenu">#style/MyTextAppearanceSmallPopupMenu
</item>
</style>
<style name="MyTextAppearanceLargePopupMenu" parent="TextAppearance.AppCompat.Widget.PopupMenu.Large">
<item name="android:textColor">#color/black</item>
</style>
<style name="MyTextAppearanceSmallPopupMenu" parent="TextAppearance.AppCompat.Widget.PopupMenu.Small">
<item name="android:textColor">#color/black</item>
</style>
But my popup menu appears with a white background and white letters instead of black. I have tested this by changing the background and that works fine.
So what am I doing wrong?
Thanks.
Edit: Figured it out, my app theme has <item name="android:textColor">#color/primary_text</item> and that seems to override whatever I do on popup menu styles.
Here's an example:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="popupMenuStyle">#style/PopupStyle</item>
<item name="textAppearanceLargePopupMenu">#style/PopupTextAppearanceLarge</item>
<item name="textAppearanceSmallPopupMenu">#style/PopupTextAppearanceSmall</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorPrimary">#android:color/white</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
<item name="android:colorBackground">#ff00ff</item>
</style>
<style name="PopupStyle" parent="Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">#ff00ff</item>
</style>
<style name="PopupTextAppearanceLarge" parent="TextAppearance.AppCompat.Light.Widget.PopupMenu.Large">
<item name="android:textColor">#ffff00</item>
</style>
<style name="PopupTextAppearanceSmall" parent="TextAppearance.AppCompat.Light.Widget.PopupMenu.Small">
<item name="android:textColor">#ffff00</item>
</style>
</resources>
Toolbar example:
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="#style/AppTheme.AppBarOverlay"
app:popupTheme="#style/AppTheme.PopupOverlay"/>
Its very late but the main reason is that the attribute android:textColor is applied to the popup menu which is defined in the main style (parent) and you can't control by defining your style for popup menu. Don't know the reason for this weird functionality but it as it is, its google .
So add <item name="android:textColor">#color/white</item> in the parent style.
I got this styles for my Android app:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:windowBackground">#color/background_new</item>
<item name="android:textColorPrimary">#color/colorAccent</item>
<item name="android:textColorHint">#color/colorAccentHint</item>
<!-- Customize your theme here. -->
</style>
<style name="MyToolBar" parent="Widget.AppCompat.ActionBar">
<!-- Support library compatibility -->
<item name="android:textColorPrimary">#color/colorAccent</item>
<item name="android:textColorSecondary">#color/colorAccent</item>
<item name="colorControlNormal">#color/colorAccent</item>
</style>
<!-- Custom searchView may be used or not-->
<style name="SearchViewStyle" parent="Widget.AppCompat.SearchView">
<!-- Gets rid of the search icon -->
<item name="searchIcon">#null</item>
<!-- Gets rid of the "underline" in the text -->
<item name="queryBackground">#null</item>
<!-- Gets rid of the search icon when the SearchView is expanded -->
<item name="searchHintIcon">#null</item>
<!-- The hint text that appears when the user has not typed anything -->
<!--<item name="closeIcon">#null</item> -->
</style>
<style name="MyCustomTabLayout" parent="Widget.Design.TabLayout">
<item name="tabTextAppearance">#style/MyCustomTabText</item>
</style>
<style name="MyCustomTabText" parent="TextAppearance.Design.Tab">
<item name="android:textSize">12sp</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="NavDrawerTextStyle" parent="Base.TextAppearance.AppCompat">
<item name="android:textSize">12sp</item>
</style>
<style name="MyCheckBox" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorControlNormal">#color/colorPrimaryTransparent</item>
<item name="colorControlActivated">#color/colorAccent</item>
</style>
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">#color/colorAccent</item>
<item name="android:textColorPrimary">#color/colorAccent</item>
<item name="android:background">#color/background1</item>
<item name="android:buttonStyle">#style/MyApp.BorderlessButton</item>
</style>
<style name="MyApp.BorderlessButton" parent="#style/Widget.AppCompat.Button.Borderless">
<item name="android:textSize">12sp</item>
</style>
<style name="MyRadioButton" parent="Theme.AppCompat.Light">
<item name="colorControlNormal">#color/colorAccent</item>
<item name="colorControlActivated">#color/colorAccent</item>
</style>
Normally i have transparent background on Toolbar of NavigationDrawler menu items click.
But sometimes theme in my app changes to Holo theme , and i can figure it out when its happens , so when i press menu items in Toolbar or in NavigationDrawler their background become blue, like in Holo theme
Where i have mistake and why its happens?
Can you publish your Android Manifest ? Maybe some activities override the base application style ?
How can I customize rate my app dialog of Zendesk. In sample app a style is added in style.xml file and it is working. But I don't know how to apply that style for Rating dialog. Please help me. Thanks in advance.
style.xml:
<!-- +++++++++++++++++++++++++++++++++ -->
<!-- Start rate my app dialogue styles -->
<!-- +++++++++++++++++++++++++++++++++ -->
<style name="rma_button">
<item name="android:background">#color/light_background</item>
<item name="android:gravity">center</item>
<item name="android:textSize">18sp</item>
<item name="android:layout_weight">1</item>
<item name="android:lineSpacingMultiplier">1.25</item>
</style>
<style name="rma_title" parent="rma_button">
<item name="android:textSize">22sp</item>
<item name="android:background">#android:color/white</item>
<item name="android:lineSpacingMultiplier">1.25</item>
</style>
<style name="rma_divider">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1px</item>
<item name="android:background">#color/divider</item>
</style>
<!-- +++++++++++++++++++++++++++++++ -->
<!-- End rate my app dialogue styles -->
<!-- +++++++++++++++++++++++++++++++ -->
<!-- ++++++++++++++++++++++++++++++++++++++++++ -->
<!-- Start rate my app dialogue feedback styles -->
<!-- ++++++++++++++++++++++++++++++++++++++++++ -->
<style name="rma_feedback_issue_cancel_button" parent="_rma_feedback_issue_cancel_button">
<item name="android:background">#drawable/white_gradient_btn</item>
<item name="android:textColor">#color/grey_text</item>
</style>
<!--
This style overrides the parent style to change the background colour of the button
depending on the state
-->
<style name="rma_feedback_issue_send_button" parent="_rma_feedback_issue_send_button">
<item name="android:layout_marginLeft">8dp</item>
<item name="android:background">#drawable/green_gray_btn_selector</item> <!-- Button colour will change -->
<item name="android:textColor">#color/green_gray_txt_selector</item>
</style>
<style name="rma_feedback_message_title" parent="_rma_feedback_message_title">
<item name="android:textColor">#color/grey_text</item>
</style>
<style name="rma_feedback_message_subtitle" parent="_rma_feedback_message_subtitle">
<item name="android:textColor">#color/grey_text</item>
<item name="android:lineSpacingMultiplier">1.25</item>
</style>
<!--
In this example we are overriding the parent style using a selector to control the colour
of the text differently whether the edittext is enabled or disabled.
-->
<style name="rma_feedback_issue_edittext" parent="_rma_feedback_issue_edittext">
<item name="android:textColor">#color/enabled_disabled_grey_selector</item>
<item name="android:textColorHint">#color/text_hint</item>
</style>
<style name="rma_feedback_divider" parent="_rma_feedback_divider">
<item name="android:background">#color/divider</item>
</style>
<style name="rma_feedback_progress" parent="_rma_feedback_progress">
<item name="android:indeterminateDrawable">#drawable/progress_green_small_holo</item>
</style>
<!-- ++++++++++++++++++++++++++++++++++++++++ -->
<!-- End rate my app dialogue feedback styles -->
<!-- ++++++++++++++++++++++++++++++++++++++++ -->
Issue resolved by creating a separate theme for the activity that is using RateMyApp dialog and applied styles for button, title and divider of dialog as below
<style name="CustomTheme" parent="Theme.AppCompat">
<item name="RateMyAppPaddingTop">#dimen/rma_padding_top</item>
<item name="RateMyAppPaddingBottom">#dimen/rma_padding_bottom</item>
<item name="RateMyAppButtonStyle">#style/rma_button_style</item>
<item name="RateMyAppTitleStyle">#style/rma_title_style</item>
<item name="RateMyAppDividerStyle">#style/rma_divider_style</item>
<item name="RateMyAppDividerHeight">#dimen/rma_divider_height</item>
</style>
<dimen name="rma_padding_top">24dp</dimen>
<dimen name="rma_padding_bottom">24dp</dimen>
<style name="rma_button_style">
<item name="android:background">#color/light_background</item>
<item name="android:gravity">center</item>
<item name="android:textSize">18sp</item>
<item name="android:layout_weight">1</item>
<item name="android:textColor">#color/black</item>
<item name="android:lineSpacingMultiplier">1.25</item>
</style>
<style name="rma_divider_style">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1px</item>
<item name="android:background">#color/divider</item>
</style>
<style name="rma_title_style" parent="rma_button">
<item name="android:textSize">22sp</item>
<item name="android:background">#android:color/white</item>
<item name="android:lineSpacingMultiplier">1.25</item>
<item name="android:textColor">#color/black</item>
</style>
I am having a problem preventing the status bar from taking on the primaryColor. I want to leave the status bar unstyled but on lollipop it is always taking on the color of the primaryColor defined in my styles.xml
Excerpt from styles:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar" >
<item name="colorPrimaryDark">?attr/colorPrimary</item>
<item name="colorAccent">?attr/colorPrimary</item>
<item name="android:textColorPrimary">#android:color/primary_text_light</item>
<item name="drawerArrowStyle">#style/DrawerArrowStyle</item>
</style>
<!-- Base application theme. -->
<style name="AppTheme.TransparentActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimaryDark">?attr/colorPrimary</item>
<item name="colorAccent">?attr/colorPrimary</item>
<item name="android:textColorPrimary">#android:color/primary_text_light</item>
<item name="drawerArrowStyle">#style/DrawerArrowStyle</item>
<item name="android:windowActionBarOverlay">true</item>
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
<item name="android:windowBackground">#color/white</item>
</style>
<!-- START Market Themes -->
<style name="AppTheme.Blue" parent="AppTheme">
<item name="colorPrimary">#color/primaryColorBlue</item>
</style>
styles/v21
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar" >
<item name="colorPrimaryDark">?attr/colorPrimary</item>
<item name="colorAccent">?attr/colorPrimary</item>
<item name="android:textColorPrimary">#android:color/primary_text_light</item>
<item name="drawerArrowStyle">#style/DrawerArrowStyle</item>
</style>
<!-- Base application theme. -->
<style name="AppTheme.TransparentActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimaryDark">?attr/colorPrimary</item>
<item name="colorAccent">?attr/colorPrimary</item>
<item name="android:textColorPrimary">#android:color/primary_text_light</item>
<item name="drawerArrowStyle">#style/DrawerArrowStyle</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">#color/black</item>
<item name="android:windowActionBarOverlay">true</item>
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
<item name="android:windowBackground">#color/white</item>
<item name="android:windowContentTransitions">true</item>
</style>
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#android:color/white</item>
</style>
<style name="ToolBarStyle" parent="">
<item name="android:elevation">#dimen/toolbar_elevation</item>
<item name="popupTheme">#style/ThemeOverlay.AppCompat.Light</item>
<item name="theme">#style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
</style>
You're telling it to be your primary colour.
The status bar gets its colour form your colorPrimaryDark so change
<item name="colorPrimaryDark">?attr/colorPrimary</item>
to
<item name="colorPrimary">?attr/colorPrimary</item>
<item name="colorPrimaryDark">#android:color/black</item>
I think this should only be necessary in your styles-v21 but I'm not close enough to anything to test it.
Docs here
<resources>
<!-- inherit from the material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="android:colorPrimary">#color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="android:colorPrimaryDark">#color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">#color/accent</item>
</style>
</resources>