Android Status Bar Prevent Coloring - android

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>

Related

Strange behavior of styles (Themes) in Android

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 ?

Android : Customize Zendesk Rate My APP UI

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>

Backward compatibity using v-21/styles.xml not working

I am trying to style my button while maintaining backwards compatibility.
I have 2 files as follows:
values/styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="colorPrimary">#color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">#color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="colorAccent">#color/accent</item>
<item name="android:textColorPrimary">#color/primary_text</item>
<item name="android:textColorSecondary">#color/secondary_text</item>
<item name="android:buttonStyle">#style/RoundedButton</item>
</style>
<style name="RoundedButton" parent="#style/Widget.AppCompat.Button">
</style>
<style name="AppName.NoActionBar" parent="AppTheme" >
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="DemoButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:minWidth">40dp</item>
</style>
</resources>
values-v21/styles.xml:
<resources>
<style name="RoundedButton" parent="Widget.AppCompat.Button">
<item name="android:background">#drawable/btn_rounded</item>
</style>
</resources>
But even then my button looses all attributes i.e. just a text is displayed as per android-studio's "XML preview". I just want the button to default to the usual Holo theme on pre-lolipop devices. It works as expected on Lolipop devices.
What am I doing wrong?
In values/styles.xml
<style name="RoundedButton" parent="#style/Widget.AppCompat.Button">
</style>
change it to as Follow :-
<style name="RoundedButton" parent="android:Widget.Holo">
</style>
I couldn't figure out the reason of why this was happening so I removed the line <item name="android:buttonStyle">#style/RoundedButton</item> from my values/styles.xml file, and added it to my values-v21/styles.xml.
I do not like this solution as there is a lot of code duplication. The only good thing about it is that it works.
Now my files look like:
values/styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="colorPrimary">#color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">#color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="colorAccent">#color/accent</item>
<item name="android:textColorPrimary">#color/primary_text</item>
<item name="android:textColorSecondary">#color/secondary_text</item>
</style>
<style name="AppName.NoActionBar" parent="AppTheme" >
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="DemoButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:minWidth">40dp</item>
</style>
</resources>
v21/styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<item name="colorPrimary">#color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">#color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="colorAccent">#color/accent</item>
<item name="android:textColorPrimary">#color/primary_text</item>
<item name="android:textColorSecondary">#color/secondary_text</item>
<item name="android:buttonStyle">#style/RoundedButton</item>
</style>
<style name="RoundedButton" parent="Widget.AppCompat.Button">
<item name="android:background">#drawable/btn_rounded</item>
</style>
<style name="AppName.NoActionBar" parent="AppTheme" >
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="DemoButton">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:minWidth">40dp</item>
</style>
</resources>

Android how to change action bar backbutton and overflow button background color on pressed state?

I want to change the background color of the backbutton and overflowmenu button on pressed state.
I am using ActionBarActivity . Appcompact v7 library.
Programmatically is it possible to change background color of the back button and overflowmenubutton ?
Below is my styles:
<resources>
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!-- <item name="windowActionBar">false</item> -->
</style>
<style name="ActionBar.Solid.Sri" parent="#style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">#drawable/ab_solid_sri</item>
<item name="backgroundStacked">#drawable/ab_stacked_solid_sri</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_sri</item>
<item name="progressBarStyle">#style/ProgressBar</item>
</style>
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:actionBarDivider">#color/action_bar_text_color</item>
<item name="actionBarDivider">#color/action_bar_text_color</item>
<item name="actionBarItemBackground">#drawable/selectable_background_sri</item>
<item name="android:actionBarStyle">#style/ActionBar.Transparent</item>
<item name="actionBarStyle">#style/ActionBar.Transparent</item>
<!--
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="actionBarStyle">#style/MyActionBar</item>
-->
<item name="actionOverflowMenuStyle">#style/OverflowMenu</item>
<item name="popupMenuStyle">#style/PopupMenu</item>
<item name="dropDownListViewStyle">#style/DropDownListView</item>
<item name="android:popupMenuStyle">#style/PopupMenu</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView</item>
<item name="actionModeBackground">#drawable/cab_background_top_sri</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_sri</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode</item>
<!--
<item name="actionOverflowButtonStyle">#style/OverFlowStyle</item>
<item name="android:actionOverflowButtonStyle">#style/OverFlowStyle</item>
-->
<item name="actionDropDownStyle">#style/DropDownNav</item>
<item name="android:actionDropDownStyle">#style/DropDownNav</item>
<item name="android:actionBarTabTextStyle">#style/TabTextStyle</item>
<item name="actionBarTabTextStyle">#style/TabTextStyle</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle</item>
<!-- <item name="actionBarStyle">#style/Theme.MyApp.ActionBar</item> -->
</style>
<style name="ActionButton.CloseMode" parent="#style/Widget.AppCompat.Light.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_sri</item>
</style>
<style name="DropDownListView" parent="#style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_sri</item>
</style>
<style name="PopupMenu" parent="#style/Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_sri</item>
</style>
<style name="MyActionBar" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:titleTextStyle">#style/TitleTextStyle</item>
<!-- Support library compatibility -->
<item name="titleTextStyle">#style/TitleTextStyle</item>
</style>
<style name="ActionBar.Transparent" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="background">#drawable/ab_transparent_sri</item>
<item name="progressBarStyle">#style/ProgressBar</item>
<item name="android:titleTextStyle">#style/TitleTextStyle</item>
<!-- Support library compatibility -->
<item name="titleTextStyle">#style/TitleTextStyle</item>
</style>
<style name="ProgressBar" parent="#style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_sri</item>
</style>
<style name="OverFlowStyle" parent="#style/Widget.AppCompat.Light.ActionButton.Overflow">
<item name="android:src">#drawable/ic_empty</item>
</style>
<style name="TitleTextStyle" parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/action_bar_text_color</item>
</style>
<style name="TabTextStyle" parent="#style/Widget.AppCompat.ActionBar.TabText">
<item name="android:textColor">#color/action_bar_text_color</item>
</style>
<style name="ActionBarTabStyle" parent="#style/Widget.AppCompat.Light.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_sri</item>
<item name="background">#drawable/tab_indicator_ab_sri</item>
</style>
<style name="DropDownNav" parent="#style/Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/spinner_background_ab_sri</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_sri</item>
<item name="android:dropDownSelector">#drawable/selectable_background_sri</item>
<item name="background">#drawable/spinner_background_ab_sri</item>
</style>
<!--
<style name="Theme.MyApp.ActionBar" parent="style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
remove shadow below action bar
<item name="android:elevation">0dp</item>
Support library compatibility
<item name="elevation">0dp</item>
<item name="android:windowContentOverlay">#null</item>
</style>
-->
<style name="OverflowMenu" parent="Widget.AppCompat.PopupMenu.Overflow">
<!-- Required for pre-Lollipop. -->
<item name="overlapAnchor">false</item>
<!-- Required for Lollipop. -->
<!-- <item name="android:overlapAnchor">false</item> -->
</style>
<style name="ProgressBarStyle" parent="#android:style/Widget.ProgressBar.Horizontal" />
<!--
<style name="MyActionBar" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:background">#drawable/actionbar_background</item>
<item name="android:windowActionBarOverlay">true</item>
Support library compatibility
<item name="background">#drawable/actionbar_background</item>
<item name="windowActionBarOverlay">true</item>
</style>
-->
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Sri.Widget" parent="#style/Theme.AppCompat">
<item name="popupMenuStyle">#style/PopupMenu</item>
<item name="dropDownListViewStyle">#style/DropDownListView</item>
</style>
</resources>
Please help me. Thank you guys.
The Action Bar Style Generator is very useful, but it generates a lot of files, most of which are irrelevant if you only want to change the background colour please look at this:
https://stackoverflow.com/a/20077381/611258.
Although i strongly urge you to use the new toolbar or its support library equivalent.

Android styles: how to change colors in styles.xml

I want to change some colors of android UI elements. But I would prefer to set a default tint color, which applies to all UI elements. I am not sure if this is possible.
If not, I want to set the "tint"-color of some UI elements, as shown below. Can anybody enlighten me?
EDIT
Based on what Entreco suggested:
My styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:textColorPrimary">#color/brown</item>
<item name="android:textColorSecondary">#color/brown</item>
<item name="android:textColorTertiary">#color/brown</item>
<item name="android:textColorPrimaryInverse">#color/brown</item>
<item name="android:textColorSecondaryInverse">#color/brown</item>
<item name="android:textColorTertiaryInverse">#color/brown</item>
<item name="colorPrimary">#color/blue</item>
<item name="colorPrimaryDark">#color/blue</item>
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="actionBarStyle">#style/MyActionBar</item>
</style>
<!-- style for the action bar backgrounds -->
<style name="MyActionBar" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="android:titleTextStyle">#style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="android:subtitleTextStyle">#style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="android:background">#color/brown</item>
<item name="titleTextStyle">#style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="subtitleTextStyle">#style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="background">#color/brown</item>
</style>
<style name="MyTheme.ActionBar.TitleTextStyle" parent="#android:style/TextAppearance">
<item name="android:textColor">#color/brown_light</item>
<item name="android:textSize">24sp</item>
</style>
</resources>
And my values-v21/styles.xml:
<resources>
<style name="AppTheme" parent="AppTheme.Base">
<item name="android:colorPrimary">#color/blue</item>
<item name="android:colorPrimaryDark">#color/blue</item>
<!-- <item name="android:colorAccent">#color/white</item> -->
</style>
</resources>
And in my Manifest:
<application android:theme="#style/AppTheme.Base" >
...
</application>
But the primary color is still the same...???
Starting from Lollipop this is straight-forward thanks to the colorPrimary attribute:
file values/styles.xml:
<!-- Base application theme. -->
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/primary</item>
<item name="colorPrimaryDark">#color/primary_dark</item>
</style>
file values-v21/styles.xml:
<style name="AppTheme" parent="AppTheme.Base">
<item name="android:colorPrimary">#color/primary</item>
<item name="android:colorPrimaryDark">#color/primary_dark</item>
<item name="android:colorAccent">#color/white</item>
</style>
Basically, you can define a color pallete for your app, and I believe for your case your want to set the colorPrimary (unverified).
More info on Material colors

Categories

Resources