Non of the solutions provided worked for me so i decided to make my own question.
I want to change the text inside the cyan area to white without changing the text of the spinner items
Themes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<!-- the theme applied to the application or activity -->
<style name="LibetasTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/ActionBar</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle</item>
<item name="android:actionBarTabBarStyle">#style/ActionBarTabBarStyle</item>
<item name="android:actionBarTabTextStyle">#style/ActionBarTabTextStyle</item>
<item name="android:actionBarItemBackground">#drawable/libertasapp_actionbar_item_background</item>
<item name="android:actionBarWidgetTheme">#style/Theme.stylingactionbar.widget</item>
<item name="android:actionDropDownStyle">#style/DropDownNav</item>
<item name="android:popupMenuStyle">#style/PopupMenu</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView</item>
<item name="android:spinnerDropDownItemStyle">#style/DropDownItem</item>
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:listSeparatorTextViewStyle">#style/PreferenceListHeader</item>
<item name="android:actionOverflowButtonStyle">#style/MyActionButtonOverflow</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:actionModeBackground">#color/libertas_orange</item>
</style>
</resources>
Styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- ActionBar styles-->
<style name="ActionBar" parent="#android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">#color/libertas_orange</item>
<item name="android:backgroundStacked">#color/libertas_white</item>
<item name="android:backgroundSplit">#color/libertas_orange</item>
<item name="android:indeterminateProgressStyle">#style/ActionBarProgressBar.MyStyle</item>
</style>
<style name="ActionBarTabTextStyle" parent="android:Widget.Holo.Light.ActionBar.TabText">
<item name="android:textColor">#color/libertas_gray</item>
</style>
<style name="ActionBarTabBarStyle" parent="#android:style/Widget.Holo.Light.ActionBar.TabBar">
<item name="android:showDividers">none</item>
</style>
<style name="ActionBarTabStyle" parent="#android:style/Widget.Holo.ActionBar.TabView">
<item name="android:background">#drawable/libertasapp_actionbar_tab_indicator</item>
</style>
<style name="PopupMenu" parent="#android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">#drawable/img_menu_dropdown_panel</item>
</style>
<style name="DropDownListView" parent="#android:style/Widget.Holo.ListView.DropDown">
<item name="android:listSelector">#color/libertas_dark_orange</item>
</style>
<style name="Theme.stylingactionbar.widget" parent="#android:style/Theme.Holo">
<item name="android:popupMenuStyle">#style/PopupMenu</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView</item>
</style>
<style name="DropDownNav" parent="#android:style/Widget.Holo.Spinner">
<item name="android:background">#drawable/libertasapp_spinner_background_ab</item>
<item name="android:popupBackground">#drawable/img_menu_dropdown_panel</item>
<item name="android:dropDownSelector">#android:color/black</item>
</style>
<style name="DropDownItem" parent="#android:style/Widget.Holo.Light.DropDownItem.Spinner">
<item name="android:textAppearance">?android:attr/textAppearanceInverse</item>
</style>
<style name="SpinnerItem" parent="#android:style/Widget.Holo.TextView.SpinnerItem">
<item name="android:textAppearance">?android:attr/textAppearanceInverse</item>
</style>
<!-- End ActionBar styles-->
<!-- Text styles-->
<style name="BusNumber" parent="#android:style/TextAppearance.Large">
<item name="android:textColor">#color/libertas_orange</item>
<item name="android:textSize">60dp</item>
</style>
<style name="BusLine" parent="#android:style/TextAppearance.Large">
<item name="android:textColor">#color/libertas_text_lightgray</item>
<item name="android:textSize">22dp</item>
</style>
<style name="BusNext" parent="#android:style/TextAppearance.Large">
<item name="android:textColor">#color/libertas_text_darkgray</item>
<item name="android:textSize">16dp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="BusNextTime" parent="#android:style/TextAppearance.Large">
<item name="android:textColor">#color/libertas_text_darkgray</item>
<item name="android:textSize">16dp</item>
<item name="android:textStyle">bold</item>
</style>
<!-- End Text styles-->
<!-- Styling loading animation-->
<style name="ActionBarProgressBar.MyStyle" parent="#android:style/Widget.Holo.ProgressBar.Small">
<item name="android:minWidth">24dp</item>
<item name="android:maxWidth">24dp</item>
<item name="android:minHeight">24dp</item>
<item name="android:maxHeight">24dp</item>
</style>
<!-- End styling loading animation-->
<style name="Widget.TextView.ListSeparator" parent="#android:style/Widget.TextView">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">14sp</item>
<item name="android:gravity">center_vertical</item>
</style>
<style name="PreferenceListHeader" parent="Widget.TextView.ListSeparator">
<item name="android:textColor">#color/libertas_orange</item>
<item name="android:textAllCaps">true</item>
<item name="android:background">#drawable/img_list_category</item>
<item name="android:paddingTop">#dimen/list_category_padding_top</item>
<item name="android:paddingBottom">#dimen/list_category_padding_bottom</item>
</style>
<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">#drawable/img_ic_overflow_white_16</item>
</style>
</resources>
Have you tried setting the spinnerItemStyle as a child of actionBarWidgetTheme? Something like this:
<style name="LibetasTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarWidgetTheme">#style/myapp.actionBarWidgetTheme</item>
</style>
<style name="Theme.stylingactionbar.widget" parent="#android:style/Theme.Holo">
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerDropDownItem</item>
</style>
<style name="SpinnerItem" parent="#android:style/Widget.TextView.SpinnerItem">
<item name="android:textColor">#FFFFFF</item>
</style>
<style name="SpinnerDropDownItem" parent="#android:style/Widget.DropDownItem.Spinner">
<item name="android:textColor">#000000</item>
</style>
Related
I have seen similar questions but possible solutions (this was the last one that I tried) don't work. The problem is that I can not set the text as bold nor change its size, it always appears non-bold and of the same size.
I need to display #+id/contactName as bold.
<TextView
android:id="#+id/contactName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:ellipsize="end"
android:maxLines="1"
android:overScrollMode="never"
android:paddingEnd="4dp"
android:textAppearance="#style/contactListTextPrimary"
tools:ignore="RtlSymmetry"
tools:text="Contact title" />
<style name="contactListTextPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">16sp</item>
</style>
The code above does not make the text bold, it always stays as it was before. Below is the complete styles.xml file.
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="windowActionModeOverlay">true</item>
<item name="preferenceTheme">#style/PreferenceThemeOverlay</item>
<item name="android:listDivider">#drawable/list_divider</item>
<item name="colorPrimaryDark">#color/color_status_bar</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="android:textColorHint">#color/grey</item>
<item name="android:tint">#FFFFFF</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="PreferenceThemeOverlay">
<item name="preferenceScreenStyle">#style/Preference.PreferenceScreen</item>
<item name="preferenceFragmentStyle">#style/PreferenceFragment</item>
<item name="preferenceCategoryStyle">#style/Preference.Category</item>
<item name="preferenceStyle">#style/Preference</item>
<item name="preferenceInformationStyle">#style/Preference.Information</item>
<item name="checkBoxPreferenceStyle">#style/Preference.CheckBoxPreference</item>
<item name="switchPreferenceCompatStyle">#style/Preference.SwitchPreferenceCompat</item>
<item name="dialogPreferenceStyle">#style/Preference.DialogPreference</item>
<item name="editTextPreferenceStyle">#style/Preference.DialogPreference.EditTextPreference
</item>
<item name="preferenceFragmentListStyle">#style/PreferenceFragmentList</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">#drawable/splash_screen</item>
</style>
<style name="LicensesTheme" parent="Theme.AppCompat.Light"></style>
<style name="searchTextHighlight">
<item name="android:textColor">#color/colorAccent</item>
<item name="android:textStyle">bold</item>
</style>
<style name="contactListTextPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
<style name="textPrimarySmall" parent="#android:style/TextAppearance.Small">
<item name="android:textColor">?android:textColorPrimary</item>
</style>
<style name="textPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:textColorPrimary</item>
</style>
<style name="textPrimaryLarge" parent="#android:style/TextAppearance.Large">
<item name="android:textColor">?android:textColorPrimary</item>
</style>
<style name="textSecondary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:textColorSecondary</item>
</style>
<style name="textSecondarySmall" parent="#android:style/TextAppearance.Small">
<item name="android:textColor">?android:textColorSecondary</item>
</style>
<style name="sectionTitleStyle" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">#color/colorAccent</item>
<item name="android:textAllCaps">true</item>
<item name="android:fontFeatureSettings">smcp</item>
<item name="android:layout_marginBottom">#dimen/activity_padding</item>
<item name="android:layout_marginTop">#dimen/activity_padding</item>
</style>
<style name="textMetaBubble">
<item name="android:textColor">?android:textColorSecondary</item>
<item name="android:textSize">14sp</item>
</style>
<style name="ProgressBar" parent="Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:minHeight">12dip</item>
<item name="background">#color/colorChipBackground</item>
</style>
<style name="ToolbarSubtitleAppearance" parent="#style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle">
<item name="android:textColor">?android:textColorSecondary</item>
<item name="android:textSize">12sp</item>
</style>
<style name="ToolbarTitleAppearance" parent="#style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textColor">?android:textColorSecondary</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">15sp</item>
</style>
<style name="roundImageView" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">50%</item>
</style>
<style name="forwardToSheetDialog" parent="ThemeOverlay.MaterialComponents.BottomSheetDialog">
<item name="bottomSheetStyle">#style/forwardToBottomSheet</item>
</style>
<style name="forwardToBottomSheet" parent="Widget.MaterialComponents.BottomSheet.Modal">
<item name="backgroundTint">#null</item>
<item name="shapeAppearanceOverlay">#style/forwardToAppearanceBottomSheetDialog</item>
</style>
<style name="forwardToAppearanceBottomSheetDialog" parent="">
<item name="cornerFamily">rounded</item>
<item name="cornerSizeTopRight">16dp</item>
<item name="cornerSizeTopLeft">16dp</item>
<item name="cornerSizeBottomRight">0dp</item>
<item name="cornerSizeBottomLeft">0dp</item>
</style>
</resources>
You say that the contactListTextPrimary style is
<style name="contactListTextPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">16sp</item>
</style>
but in the full styles file you have just
<style name="contactListTextPrimary" parent="#android:style/TextAppearance.Medium">
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
Make them match according to the longer version and you should see a bold font.
I have a custom ToolBar layout. I am using that in many activities. In all activities except the ones which uses TabLayout, the menu is light theme. But in Tab activities, it is holo theme. How can I fix this?
styles.xml
<resources>
<style name="AppTheme" parent="MyMaterialTheme.Base">
</style>
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#color/primaryBlue</item>
<item name="colorPrimaryDark">#color/secondaryBlue</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="actionOverflowMenuStyle">#style/OverflowMenu</item>
</style>
<style name="OverflowMenu" parent="Widget.AppCompat.Light.PopupMenu.Overflow">
<item name="android:windowDisablePreview">true</item>
<item name="overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">5.0dp</item>
<!--<item name="android:popupBackground">#FFF</item>-->
</style>
<style name="ToolbarStyle" parent="#style/ThemeOverlay.AppCompat.ActionBar">
<!-- Customize color of navigation drawer icon and back arrow -->
<item name="colorControlNormal">#color/primaryWhite</item>
</style>
<style name="Base.Widget.Design.TabLayout" parent="android:Widget">
<item name="tabIndicatorColor">#color/primaryBlack</item>
<item name="tabIndicatorHeight">2dp</item>
<item name="tabPaddingStart">12dp</item>
<item name="tabPaddingEnd">12dp</item>
<item name="tabBackground">?attr/selectableItemBackground</item>
<item name="tabTextAppearance">#style/TabTheme</item>
<item name="tabSelectedTextColor">#color/primaryBlack</item>
</style>
<style name="TabTheme" parent="TextAppearance.AppCompat.Button">
<item name="android:textSize">#dimen/design_tab_text_size</item>
<item name="android:textColor">#color/primaryBlack</item>
<item name="textAllCaps">true</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowDisablePreview">true</item>
</style>
<style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowIsTranslucent">true</item>
</style>
<style name="StarRatingBar" parent="#android:style/Widget.RatingBar">
<item name="android:progressDrawable">#drawable/rating_bar_selector</item>
<item name="android:minHeight">48dip</item>
<item name="android:maxHeight">48dip</item>
<item name="android:numStars">5</item>
<item name="android:rating">4</item>
<item name="android:stepSize">1</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">48dip</item>
<item name="android:layout_marginLeft">4dip</item>
<item name="android:layout_marginTop">4dip</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
Add the below line into your theme attribute:
<item name="android:textColorSecondary">#android:color/white</item>
My action bare menu items have back text in Android 5.0. I am trying to change it to white but the style for android:actionMenuTextColor seems to be ignored and the text appears black
How can I change the menu item text color to white?
Here is my styles.xml i do not have a theme.xml
<style name="Theme.Red" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarItemBackground">#drawable/selectable_background_red</item>
<item name="popupMenuStyle">#style/PopupMenu.Red</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Red</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle.Red</item>
<item name="actionDropDownStyle">#style/DropDownNav.Red</item>
<item name="actionBarStyle">#style/ActionBar.Solid.Red</item>
<item name="actionModeBackground">#drawable/cab_background_top_red</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_red</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Red</item>
<!-- Light.DarkActionBar specific -->
<item name="actionBarWidgetTheme">#style/Theme.Red.Widget</item>
<item name="android:editTextBackground">#drawable/red_edit_text_holo_light</item>
<item name="android:textColorHighlight">#99e84e40</item>
<item name="android:textSelectHandleLeft">#drawable/red_text_select_handle_left</item>
<item name="android:textSelectHandleRight">#drawable/red_text_select_handle_right</item>
<item name="android:textSelectHandle">#drawable/red_text_select_handle_middle</item>
<item name="android:autoCompleteTextViewStyle">#style/AutoCompleteTextViewred</item>
<item name="android:listChoiceIndicatorMultiple">#drawable/red_btn_check_holo_light</item>
<item name="android:listChoiceIndicatorSingle">#drawable/red_btn_radio_holo_light</item>
<item name="android:buttonStyle">#style/Buttonred</item>
<item name="android:imageButtonStyle">#style/ImageButtonred</item>
<item name="android:dropDownSpinnerStyle">#style/Spinnerred</item>
<item name="android:progressBarStyleHorizontal">#style/ProgressBarred</item>
<item name="android:seekBarStyle">#style/SeekBarred</item>
<item name="android:ratingBarStyle">#style/RatingBarred</item>
<item name="android:ratingBarStyleIndicator">#style/RatingBarBigred</item>
<item name="android:ratingBarStyleSmall">#style/RatingBarSmallred</item>
<item name="android:buttonStyleToggle">#style/Togglered</item>
<item name="android:listChoiceBackgroundIndicator">#drawable/red_list_selector_holo_light</item>
<item name="android:activatedBackgroundIndicator">#drawable/red_activated_background_holo_light</item>
<item name="android:fastScrollThumbDrawable">#drawable/red_fastscroll_thumb_holo</item>
<item name="android:actionMenuTextColor">#color/white</item>
</style>
<style name="myCustomMenuTextApearance" parent="#android:style/TextAppearance.Widget.IconMenu.Item">
<item name="android:textColor">#android:color/primary_text_dark</item>
</style>
<style name="ActionBar.Solid.Red" parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">#drawable/ab_solid_red</item>
<item name="backgroundStacked">#drawable/ab_stacked_solid_red</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_red</item>
<item name="progressBarStyle">#style/ProgressBar.Red</item>
</style>
<style name="ActionBar.Transparent.Red" parent="#style/Widget.AppCompat.ActionBar">
<item name="background">#drawable/ab_transparent_red</item>
<item name="progressBarStyle">#style/ProgressBar.Red</item>
</style>
<style name="PopupMenu.Red" parent="#style/Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_red</item>
</style>
<style name="DropDownListView.Red" parent="#style/Widget.AppCompat.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_red</item>
</style>
<style name="ActionBarTabStyle.Red" parent="#style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_red</item>
</style>
<style name="DropDownNav.Red" parent="#style/Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/spinner_background_ab_red</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_red</item>
<item name="android:dropDownSelector">#drawable/selectable_background_red</item>
</style>
<style name="ProgressBar.Red" parent="#style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_red</item>
</style>
<style name="ActionButton.CloseMode.Red" parent="#style/Widget.AppCompat.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_red</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Red.Widget" parent="#style/Theme.AppCompat">
<item name="popupMenuStyle">#style/PopupMenu.Red</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Red</item>
</style>
<style name="AutoCompleteTextViewred" parent="android:Widget.Holo.Light.AutoCompleteTextView">
<item name="android:dropDownSelector">#drawable/red_list_selector_holo_light</item>
<item name="android:background">#drawable/red_edit_text_holo_light</item>
</style>
<style name="Buttonred" parent="android:Widget.Holo.Light.Button">
<item name="android:background">#drawable/red_btn_default_holo_light</item>
</style>
<style name="ImageButtonred" parent="android:Widget.Holo.Light.ImageButton">
<item name="android:background">#drawable/red_btn_default_holo_light</item>
</style>
<style name="Spinnerred" parent="android:Widget.Holo.Light.Spinner">
<item name="android:background">#drawable/red_spinner_background_holo_light</item>
<item name="android:dropDownSelector">#drawable/red_list_selector_holo_light</item>
</style>
<style name="Tabred">
<item name="android:gravity">center_horizontal</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
<item name="android:background">#drawable/red_tab_indicator_holo</item>
<item name="android:layout_width">0dip</item>
<item name="android:layout_weight">1</item>
<item name="android:minWidth">80dip</item>
</style>
<style name="TabTextred">
<item name="android:textColor">#000000</item>
<item name="android:textSize">12sp</item>
<item name="android:textStyle">bold</item>
<!-- v14 <item name="android:textAllCaps">true</item> -->
<item name="android:ellipsize">marquee</item>
<item name="android:maxLines">2</item>
<item name="android:maxWidth">180dip</item>
</style>
<style name="ProgressBarred" parent="android:Widget.Holo.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/red_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_progress_indeterminate_horizontal_holo_light</item>
</style>
<style name="SeekBarred" parent="android:Widget.Holo.Light.SeekBar">
<item name="android:progressDrawable">#drawable/red_scrubber_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_scrubber_progress_horizontal_holo_light</item>
<item name="android:thumb">#drawable/red_scrubber_control_selector_holo_light</item>
</style>
<style name="RatingBarred" parent="android:Widget.Holo.Light.RatingBar">
<item name="android:progressDrawable">#drawable/red_ratingbar_full_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_ratingbar_full_holo_light</item>
</style>
<style name="RatingBarBigred" parent="android:Widget.Holo.Light.RatingBar.Indicator">
<item name="android:progressDrawable">#drawable/red_ratingbar_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_ratingbar_holo_light</item>
</style>
<style name="RatingBarSmallred" parent="android:Widget.Holo.Light.RatingBar.Small">
<item name="android:progressDrawable">#drawable/red_ratingbar_small_holo_light</item>
<item name="android:indeterminateDrawable">#drawable/red_ratingbar_small_holo_light</item>
</style>
<style name="Togglered" parent="android:Widget.Holo.Light.Button.Toggle">
<item name="android:background">#drawable/red_btn_toggle_holo_light</item>
</style>
Try to add to your values-v21:
<item name="android:actionBarPopupTheme">#style/Theme.Red.Widget</item>
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>
I'm using ActionBarSherlock and HoloEverywhere in my app. I used the ActionBar Style Generator to generate my styles and then modified them a bit by hand for text colors, etc.
I'm having a problem where my ActionBar looks correct on my Android 4.2 device (that is, orange with white text), but on my Android 2.3 device the ActionBar is black with grey text.
Does anyone know what might cause this?
<style name="Theme.MyApp" parent="#style/Holo.Theme.Light.DarkActionBar">
<item name="android:actionBarItemBackground">#drawable/selectable_background_MyApp</item>
<item name="android:popupMenuStyle">#style/PopupMenu.MyApp</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.MyApp</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle.MyApp</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.MyApp</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid.MyApp</item>
<item name="android:actionModeBackground">#drawable/cab_background_top_MyApp</item>
<item name="android:actionModeSplitBackground">#drawable/cab_background_bottom_MyApp</item>
<item name="android:actionModeCloseButtonStyle">#style/ActionButton.CloseMode.MyApp</item>
<!-- <item name="android:textColorPrimary">#FFFFFF</item> -->
<item name="android:spinnerDropDownItemStyle">#style/ActionBar.Solid.MyApp.NavigationDropDownStyle</item>
</style>
<style name="ActionBar.Solid.MyApp" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#drawable/ab_solid_MyApp</item>
<item name="android:backgroundStacked">#drawable/ab_stacked_solid_MyApp</item>
<item name="android:backgroundSplit">#drawable/ab_bottom_solid_MyApp</item>
<item name="android:progressBarStyle">#style/ProgressBar.MyApp</item>
<item name="android:titleTextStyle">#style/ActionBar.Solid.MyApp.TitleTextStyle</item>
</style>
<style name="ActionBar.Solid.MyApp.NavigationDropDownStyle" parent="#android:style/Widget.Holo.DropDownItem.Spinner">
<item name="android:textAppearance">#style/ActionBar.Solid.MyApp.NavigationDropDownStyle.TextStyle</item>
</style>
<style name="ActionBar.Solid.MyApp.NavigationDropDownStyle.TextStyle" parent="#android:style/Widget">
<item name="android:textColor">#color/white</item>
<item name="android:textSize">18sp</item>
</style>
<style name="ActionBar.Solid.MyApp.TitleTextStyle" parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
<item name="android:textSize">18sp</item>
<!-- <item name="android:fontFamily">sans-serif-medium</item> -->
</style>
<style name="ActionBar.Transparent.MyApp" parent="#android:style/Widget.Holo.ActionBar">
<item name="android:background">#drawable/ab_transparent_MyApp</item>
<item name="android:progressBarStyle">#style/ProgressBar.MyApp</item>
</style>
<style name="PopupMenu.MyApp" parent="#android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_MyApp</item>
</style>
<style name="DropDownListView.MyApp" parent="#android:style/Widget.Holo.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_MyApp</item>
</style>
<style name="ActionBarTabStyle.MyApp" parent="#android:style/Widget.Holo.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_MyApp</item>
</style>
<style name="DropDownNav.MyApp" parent="#android:style/Widget.Holo.Spinner">
<item name="android:background">#drawable/spinner_background_ab_MyApp</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_MyApp</item>
<item name="android:dropDownSelector">#drawable/selectable_background_MyApp</item>
</style>
<style name="ProgressBar.MyApp" parent="#android:style/Widget.Holo.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_MyApp</item>
</style>
<style name="ActionButton.CloseMode.MyApp" parent="#android:style/Widget.Holo.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_MyApp</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.MyApp.Widget" parent="#android:style/Theme.Holo">
<item name="android:popupMenuStyle">#style/PopupMenu.MyApp</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.MyApp</item>
</style>
--------------- EDIT ----------------------
So I'm now having a problem where the action bar is taking up the entire screen on the Android 2.3 device (but works fine on Android 4.2). Do I need to remove the "android:" from the parent attributes?
parent="#android:style/Widget.Holo.ListPopupWindow"
When I tried this, Eclipse was unable to find the theme.
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.MyApp" parent="#style/Holo.Theme.Light.DarkActionBar">
<item name="android:actionBarItemBackground">#drawable/selectable_background_MyApp</item>
<item name="android:popupMenuStyle">#style/PopupMenu.MyApp</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.MyApp</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle.MyApp</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.MyApp</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid.MyApp</item>
<item name="android:actionModeBackground">#drawable/cab_background_top_MyApp</item>
<item name="android:actionModeSplitBackground">#drawable/cab_background_bottom_MyApp</item>
<item name="android:actionModeCloseButtonStyle">#style/ActionButton.CloseMode.MyApp</item>
<!-- <item name="android:textColorPrimary">#FFFFFF</item> -->
<item name="android:spinnerDropDownItemStyle">#style/ActionBar.Solid.MyApp.NavigationDropDownStyle</item>
<item name="actionBarItemBackground">#drawable/selectable_background_MyApp</item>
<item name="popupMenuStyle">#style/PopupMenu.MyApp</item>
<item name="dropDownListViewStyle">#style/DropDownListView.MyApp</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle.MyApp</item>
<item name="actionDropDownStyle">#style/DropDownNav.MyApp</item>
<item name="actionBarStyle">#style/ActionBar.Solid.MyApp</item>
<item name="actionModeBackground">#drawable/cab_background_top_MyApp</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_MyApp</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode.MyApp</item>
<!-- <item name="textColorPrimary">#FFFFFF</item> -->
<item name="spinnerDropDownItemStyle">#style/ActionBar.Solid.MyApp.NavigationDropDownStyle</item>
</style>
<style name="ActionBar.Solid.MyApp" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#drawable/ab_solid_MyApp</item>
<item name="android:backgroundStacked">#drawable/ab_stacked_solid_MyApp</item>
<item name="android:backgroundSplit">#drawable/ab_bottom_solid_MyApp</item>
<item name="android:progressBarStyle">#style/ProgressBar.MyApp</item>
<item name="android:titleTextStyle">#style/ActionBar.Solid.MyApp.TitleTextStyle</item>
<item name="background">#drawable/ab_solid_MyApp</item>
<item name="backgroundStacked">#drawable/ab_stacked_solid_MyApp</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_MyApp</item>
<item name="progressBarStyle">#style/ProgressBar.MyApp</item>
<item name="titleTextStyle">#style/ActionBar.Solid.MyApp.TitleTextStyle</item>
</style>
<style name="ActionBar.Solid.MyApp.NavigationDropDownStyle" parent="#android:style/Widget.Holo.DropDownItem.Spinner">
<item name="android:textAppearance">#style/ActionBar.Solid.MyApp.NavigationDropDownStyle.TextStyle</item>
</style>
<style name="ActionBar.Solid.MyApp.NavigationDropDownStyle.TextStyle" parent="#android:style/Widget">
<item name="android:textColor">#color/white</item>
<item name="android:textSize">18sp</item>
</style>
<style name="ActionBar.Solid.MyApp.TitleTextStyle" parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
<item name="android:textSize">18sp</item>
<!-- <item name="android:fontFamily">sans-serif-medium</item> -->
</style>
<style name="ActionBar.Transparent.MyApp" parent="#android:style/Widget.Holo.ActionBar">
<item name="android:background">#drawable/ab_transparent_MyApp</item>
<item name="android:progressBarStyle">#style/ProgressBar.MyApp</item>
<item name="background">#drawable/ab_transparent_MyApp</item>
<item name="progressBarStyle">#style/ProgressBar.MyApp</item>
</style>
<style name="PopupMenu.MyApp" parent="#android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_MyApp</item>
</style>
<style name="DropDownListView.MyApp" parent="#android:style/Widget.Holo.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_MyApp</item>
</style>
<style name="ActionBarTabStyle.MyApp" parent="#android:style/Widget.Holo.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_MyApp</item>
<item name="background">#drawable/tab_indicator_ab_MyApp</item>
</style>
<style name="DropDownNav.MyApp" parent="#android:style/Widget.Holo.Spinner">
<item name="android:background">#drawable/spinner_background_ab_MyApp</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_MyApp</item>
<item name="android:dropDownSelector">#drawable/selectable_background_MyApp</item>
<item name="background">#drawable/spinner_background_ab_MyApp</item>
</style>
<style name="ProgressBar.MyApp" parent="#android:style/Widget.Holo.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_MyApp</item>
</style>
<style name="ActionButton.CloseMode.MyApp" parent="#android:style/Widget.Holo.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_MyApp</item>
<item name="background">#drawable/btn_cab_done_MyApp</item>
</style>
</resources>
As per the official docs, you need to also declare the attributes without the android: namespace. In your case, those attributes are only getting applied to the native implementation.