Change DatePicker Text Color - android

I want to change the text color of DatePicker.
I have tried couple of suggestions found here but nothing has worked for me.
The text color, and the selected background stays the same.
The top header background did changed.
<style name="MyThemeDesign" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#color/btnColor</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="android:datePickerStyle">#style/MyDatePickerStyle</item>
</style>
<style name="MyDatePickerStyle" parent="#android:style/Widget.Material.Light.DatePicker">
<item name="android:headerBackground">#color/orange</item>
<item name="android:text">#color/white</item>
<item name="android:calendarTextColor">#color/white</item>
<item name="android:dayOfWeekBackground">#color/white</item>
<item name="android:selectedWeekBackgroundColor">#color/colorRed</item>
<item name="android:yearListSelectorColor">#color/colorRed</item>
<item name="android:colorPrimary">#color/white</item>
<item name="android:colorPrimaryDark">#color/white</item>
<item name="android:colorBackgroundCacheHint">#color/colorRed</item>
<item name="colorAccent">#color/white</item>
<item name="android:textColorPrimary">#color/white</item>
<item name="android:datePickerMode">calendar</item>
<item name="android:minDate">01/01/2017</item>
</style>

In styles.xml:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
...
<item name="android:datePickerStyle">#style/MyDatePickerStyle</item>
</style>
<style name="MyDatePickerStyle" parent="#android:style/Widget.DeviceDefault.DatePicker">
<item name="android:headerBackground">#color/red</item>
<item name="android:headerMonthTextAppearance">#style/MyDatePickerTextAppearance</item>
</style>
<style name="MyDatePickerTextAppearance" parent="TextAppearance.AppCompat.Body1">
<item name="android:textColor">#drawable/my_color_state_list</item>
</style>
drawable/my_color_state_list.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Month color -->
<item android:color="#color/yellow" android:state_selected="true"/>
<!-- Year color -->
<item android:color="#color/purple" />
</selector>
If you also want to control the selected date color, then add this theme to style.xml:
<style name="MyDatePickerTheme" parent="AppTheme">
<item name="colorAccent">#color/blue</item>
</style>
In layout:
<DatePicker
android:theme="#style/MyDatePickerTheme"
.../>
Result:

Related

Overriding Style XML for Component

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>

ButtonbarStyle grey Border

Hi I do have created a theme/style for an AlertDialog. However I do have the problem with the button bar, that it's still grey even after I have set the background color. Also the Button inside the bar is not filling the bar as I expected. I tried serveral things but I was not able to get this done.
<style name="MyBorderlessButton">
<!-- Set background drawable and text size of the buttons here -->
<item name="android:background">#drawable/button_dark_border</item>
<item name="android:textColor">#color/white</item>
</style>
<style name="MyButtonBar" parent="#android:style/ButtonBar">
<!-- Define a background for the button bar and a divider between the buttons here -->
<item name="android:divider">?android:attr/dividerVertical</item>
<item name="android:dividerPadding">1dp</item>
<item name="android:showDividers">middle</item>
<item name="android:padding">3dp</item>
<item name="android:background">#color/transparent</item>
</style>
<style name="MyAlertDialogTitle">
<item name="android:maxLines">1</item>
<item name="android:scrollHorizontally">true</item>
</style>
<style name="MyAlertTextAppearance">
<!-- Set text size and color of title and message here -->
<item name="android:textColor">#color/white</item>
</style>
<style name="MyAlertDialogTheme" parent="android:Theme.Dialog">
<item name="android:windowBackground">#color/transparent</item>
<item name="android:windowTitleStyle">#style/MyAlertDialogTitle</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowMinWidthMajor">#android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">#android:dimen/dialog_min_width_minor</item>
<item name="android:windowIsFloating">true</item>
<item name="android:textAppearanceMedium">#style/MyAlertTextAppearance</item>
<!--
If you don't want your own button bar style use
#android:style/Holo.Light.ButtonBar.AlertDialog
and
?android:attr/borderlessButtonStyle
instead of #style/MyButtonBar and #style/MyBorderlessButton
-->
<item name="android:buttonBarStyle">#style/MyButtonBar</item>
<item name="android:buttonBarButtonStyle">#style/MyBorderlessButton</item>
</style>
<style name="MyAlertDialogStyle">
<!-- Define background colors of title, message, buttons, etc. here -->
<item name="android:background">#color/drawer_background</item>
</style>
button_dark_border:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<solid android:color="#color/drawer_background" />
<stroke android:width="1dip" android:color="#color/white"/>
</shape>
How can I make the Button bar also black and the Button fill the AlertDialog again?
I fixed the problem updating the styles file. After some time i found that the parent attribute was blocking some of my changes. Here is my styles.xml now
<style name="Theme.PeeDeeTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:alertDialogTheme">#style/PeeDeeAlertDialogTheme</item>
<item name="android:alertDialogStyle">#style/PeeDeeAlertDialogStyle</item>
</style>
<style name="MyBorderlessButton">
<!-- Set background drawable and text size of the buttons here -->
<item name="android:background">#color/primarycolor_dark</item>
<item name="android:textColor">#color/white</item>
<!--
Setting the weight as follows should result in equally wide buttons filling the alert dialog width,
but instead they span further out of the dialog, breaking in multiple lines though
-->
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_height">15dp</item>
<item name="android:height">#null</item>
</style>
<style name="MyButtonBar">
<!-- Define a background for the button bar and a divider between the buttons here -->
<item name="android:divider">?android:attr/listDivider</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:showDividers">none</item>
<item name="android:padding">0dp</item>
<item name="android:background">#color/transparent</item>
<!-- Making sure, the button bar uses parent width and is not restricted in height -->
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:height">#null</item>
<item name="android:minHeight">#null</item>
</style>
<style name="MyAlertDialogTitle">
<item name="android:maxLines">1</item>
<item name="android:scrollHorizontally">true</item>
<item name="android:textColor">#color/defaultcolor_drawer</item>
</style>
<style name="MyAlertTextAppearance">
<!-- Set text size and color of title and message here -->
<item name="android:textColor">#color/white</item>
</style>
<style name="MyAlertDialogTheme">
<item name="android:windowBackground">#color/transparent</item>
<item name="android:windowTitleStyle">#style/MyAlertDialogTitle</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowMinWidthMajor">#android:dimen/dialog_min_width_major</item>
<item name="android:windowMinWidthMinor">#android:dimen/dialog_min_width_minor</item>
<item name="android:windowIsFloating">true</item>
<item name="android:textAppearanceMedium">#style/MyAlertTextAppearance</item>
<item name="android:buttonBarStyle">#style/MyButtonBar</item>
<item name="android:buttonBarButtonStyle">#style/MyBorderlessButton</item>
<item name="android:panelBackground">#color/transparent</item>
</style>
<style name="MyAlertDialogStyle">
<!-- Define background colors of title, message, buttons, etc. here -->
<item name="android:fullDark">#color/drawer_background</item>
<item name="android:topDark">#color/drawer_background</item>
<item name="android:centerDark">#color/drawer_background</item>
<item name="android:bottomDark">#color/transparent</item>
<item name="android:fullBright">#color/drawer_background</item>
<item name="android:topBright">#color/drawer_background</item>
<item name="android:centerBright">#color/drawer_background</item>
<item name="android:bottomBright">#color/transparent</item>
<item name="android:bottomMedium">#color/transparent</item>
<item name="android:centerMedium">#color/drawer_background</item>
<item name="android:panelBackground">#color/drawer_background</item>
</style>

Change ActionBarTab line between items

I am working on Android project, what I can't change is line between Tab items. Now it's light white / gray, but I want to make it black. I've tried to change style ActionBar.Solid.A with background to black, but it didn't solve the problem. Before I ask question I've check several similar problems, but didn't find solution...
Theme Style
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.A" parent="#android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarItemBackground">#drawable/selectable_background_A</item>
<item name="android:popupMenuStyle">#style/PopupMenu.A</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.A</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle.A</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.A</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid.A</item>
<item name="android:actionModeBackground">#drawable/cab_background_top_A</item>
<item name="android:actionModeSplitBackground">#drawable/cab_background_bottom_A</item>
<item name="android:actionModeCloseButtonStyle">#style/ActionButton.CloseMode.A</item>
<!--<item name="android:actionOverflowButtonStyle">#style/Widget.ActionButton.Overflow</item>-->
<!-- Light.DarkActionBar specific -->
<item name="android:actionBarWidgetTheme">#style/Theme.A.Widget</item>
</style>
<style name="ActionBar.Solid.A" parent="#android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:titleTextStyle">#style/Theme.A.TitleTextStyle</item>
<item name="android:background">#drawable/ab_solid_A</item>
<item name="android:backgroundStacked">#drawable/ab_stacked_solid_A</item>
<item name="android:backgroundSplit">#drawable/ab_bottom_solid_A</item>
<item name="android:progressBarStyle">#style/ProgressBar.A</item>
</style>
<style name="ActionBar.Transparent.A" parent="#android:style/Widget.Holo.ActionBar">
<item name="android:background">#drawable/ab_transparent_A</item>
<item name="android:progressBarStyle">#style/ProgressBar.A</item>
</style>
<style name="PopupMenu.A" parent="#android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_A</item>
</style>
<style name="DropDownListView.A" parent="#android:style/Widget.Holo.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_A</item>
<item name="android:textColor">#color/main_white_color</item>
</style>
<style name="ActionBarTabStyle.A" parent="#android:style/Widget.Holo.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_A</item>
</style>
<style name="DropDownNav.A" parent="#android:style/Widget.Holo.Spinner">
<item name="android:background">#drawable/spinner_background_ab_A</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_A</item>
<item name="android:dropDownSelector">#drawable/selectable_background_A</item>
</style>
<style name="DropDownSpinner.A" parent="#android:style/Widget.Holo.Light.Spinner">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_spinner</item>
</style>
<style name="ProgressBar.A" parent="#android:style/Widget.Holo.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_A</item>
</style>
<style name="ActionButton.CloseMode.A" parent="#android:style/Widget.Holo.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_A</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.A.Widget" parent="#android:style/Theme.Holo">
<item name="android:popupMenuStyle">#style/PopupMenu.A</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.A</item>
<item name="android:textColor">#color/main_white_color</item>
</style>
<!-- ActionBar TitleTextStyle styles -->
<style name="Theme.A.TitleTextStyle" parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/main_white_color</item>
</style>
<!-- ActionBar SettingIcon style -->
<style name="Widget.ActionButton.Overflow" parent="#android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">#drawable/ic_dots</item>
</style>
</resources>
What you want to change is the ActionBarTab divider color. You can do it like this:
Inside ActionBarTabStyle.A definition, add:
<item name="android:actionBarDivider">#drawable/tab_divider</item>
The tab_divider drawable is an XML file as well:
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="90"
android:toDegrees="90" >
<shape android:shape="line" >
<stroke
android:dashWidth="3dp"
android:width="4dp"
android:color="#android:color/black" />
</shape>
</rotate>
Edit: An alternative solution is simply changing your Theme.A theme directly, adding:
<item name="actionBarDivider">#android:color/black</item>
Note that the android: prefix is not being used.

How can I set the background color of the overflow menu in Android?

I am trying to set a custom background color to the overflow menu. However, I am unable to do so. This is what I tried:
<resources>
<style name="TranslucentTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/TranslucentActionBar</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:popupMenuStyle">#style/PopupMenu</item>
</style>
<style name="PopupMenu" parent="#android:Widget.Holo.Light.PopupWindow">
<item name="android:popupBackground">#color/transparent_black</item>
</style>
<style name="TranslucentActionBar" parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">#null</item>
<item name="android:logo">#drawable/actionbar_logo_space</item>
</style>
</resources>
What am I doing wrong?
Try this:
1) Add style to DropDownListView:
<style name="OdnakoDropDownListView" parent="#android:Widget.Holo.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background</item>
<item name="android:background">#android:color/black</item>
<item name="actionMenuTextColor">#android:color/white</item>
</style>
2) Create selectable_background.xml in yours /res/drawable
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/list_focused" android:state_focused="true" android:state_pressed="false"/>
<item android:drawable="#drawable/ic_launcher" android:state_pressed="true"/>
<item android:drawable="#android:color/blue"/>
</selector>
3) Add item to yours theme:
<style name="TranslucentTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- other attributes-->
<item name="android:dropDownListViewStyle">#style/OdnakoDropDownListView</item>
</style>

Change text color and size of actionbar

I try to change text color and size of my actionbar through the style resources:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.Example3" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarItemBackground">#drawable/selectable_background_example3</item>
<item name="android:popupMenuStyle">#style/PopupMenu.Example3</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Example3</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle.Example3</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.Example3</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid.Example3</item>
<item name="android:actionModeBackground">#drawable/cab_background_top_example3</item>
<item name="android:actionModeSplitBackground">#drawable/cab_background_bottom_example3</item>
<item name="android:actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Example3</item>
</style>
<style name="ActionBar.Solid.Example3" parent="#android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">#drawable/ab_solid_example3</item>
<item name="android:backgroundStacked">#drawable/ab_stacked_solid_example3</item>
<item name="android:backgroundSplit">#drawable/ab_bottom_solid_example3</item>
<item name="android:progressBarStyle">#style/ProgressBar.Example3</item>
</style>
<style name="Theme.Example3.ActionBar.Solid.Example3.TitleTextStyle" parent="#android:style/TextAppearance.Medium">
<item name="android:textSize">20sp</item>
<item name="android:textColor">#color/white</item>
</style>
<style name="ActionBar.Transparent.Example3" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#drawable/ab_transparent_example3</item>
<item name="android:progressBarStyle">#style/ProgressBar.Example3</item>
</style>
<style name="PopupMenu.Example3" parent="#android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_example3</item>
</style>
<style name="DropDownListView.Example3" parent="#android:style/Widget.Holo.Light.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_example3</item>
</style>
<style name="ActionBarTabStyle.Example3" parent="#android:style/Widget.Holo.Light.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_example3</item>
</style>
<style name="DropDownNav.Example3" parent="#android:style/Widget.Holo.Light.Spinner">
<item name="android:background">#drawable/spinner_background_ab_example3</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_example3</item>
<item name="android:dropDownSelector">#drawable/selectable_background_example3</item>
</style>
<style name="ProgressBar.Example3" parent="#android:style/Widget.Holo.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_example3</item>
</style>
<style name="ActionButton.CloseMode.Example3" parent="#android:style/Widget.Holo.Light.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_example3</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Example3.Widget" parent="#android:style/Theme.Holo">
<item name="android:popupMenuStyle">#style/PopupMenu.Example3</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Example3</item>
</style>
</resources>
The above style.xml contains following code part, which should change text color and size, but it happens nothing on my actionbar:
<style name="Theme.Example3.ActionBar.Solid.Example3.TitleTextStyle" parent="#android:style/TextAppearance.Medium">
<item name="android:textSize">20sp</item>
<item name="android:textColor">#color/white</item>
</style>
What is wrong?
Thanks!!
<item name="android:titleTextStyle">#style/Theme.Example3.ActionBar.Solid.Example3.TitleTextStyle</item>
is missing in <style name="ActionBar.Solid.Example3">
The problem is that you need to link the third block of style from inside the second block of style:
<style name="ActionBar.Solid.Example3" parent="#android:style/Widget.Holo.Light.ActionBar.Solid">
<item name="android:background">#drawable/ab_solid_example3</item>
<item name="android:backgroundStacked">#drawable/ab_stacked_solid_example3</item>
<item name="android:backgroundSplit">#drawable/ab_bottom_solid_example3</item>
<item name="android:progressBarStyle">#style/ProgressBar.Example3</item>
<item name="android:titleTextStyle">#style/Theme.Example3.ActionBar.Solid.Example3.TitleTextStyle</item>
</style>

Categories

Resources