I've got one trouble while changing android design. I need to change action bar menu background color to black. I know, there are lots of answers for this question. I tried many of them. But nothing worked for me.
Oh, and i forgot to say, that i am not a very skilled android developer. Here's my styles file (v21)
<?xml version="1.0" encoding="utf-8"?>
<style name="AppTheme" parent="@style/Theme.AppCompat.Light">
<item name="colorPrimary">@color/mainColor</item>
<item name="colorPrimaryDark">@color/secondaryColor</item>
<item name="colorAccent">@color/goldColor</item>
<item name="colorControlNormal">@color/mainColor</item>
<item name="colorControlActivated">@color/secondaryColor</item>
<item name="colorControlHighlight">@color/secondaryColor</item>
<item name="android:navigationBarColor">@color/blackColor</item>
<item name="colorSwitchThumbNormal">@color/secondaryTextColor</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:textColorPrimary">@color/goldColor</item>
<item name="android:windowBackground">@color/blackColor</item>
<item name="android:itemTextAppearance">@color/normalTextColor</item>
<item name="android:buttonStyle">@style/ButtonStyle</item>
<item name="android:actionMenuTextColor">@color/blackColor</item>
<item name="actionMenuTextColor">@color/blackColor</item>
<item name="android:actionBarPopupTheme">@style/Theme.Red.Widget</item>
<item name="android:popupTheme">@color/blackColor</item>
</style>
<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="PopupMenu.Red" parent="@style/Widget.AppCompat.PopupMenu">
<item name="android:popupBackground">@color/blackColor</item>
</style>
<style name="DropDownListView.Red" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:listSelector">@color/blackColor</item>
</style>
<color name="mainColor">#373737</color>
<color name="secondaryColor">#252525</color>
<color name="goldColor">#cea939</color>
<style name="Divider">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:background">?android:attr/listDivider</item>
</style>
<style name="ButtonStyle" parent="android:Widget.Button">
<item name="android:background">@drawable/custom_btn</item>
</style>
And here is my code for lower android releases.
<resources>
<style name="AppTheme" parent="@style/Theme.AppCompat.Light">
<item name="colorPrimary">@color/mainColor</item>
<item name="colorPrimaryDark">#856f2d</item>
<item name="colorAccent">@color/mainColor</item>
<item name="colorControlNormal">@color/mainColor</item>
<item name="colorControlActivated">#856f2d</item>
<item name="colorControlHighlight">#856f2d</item>
<item name="colorSwitchThumbNormal">@color/mainColor</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:textColorPrimary">@color/blackColor</item>
<item name="android:textColorSecondary">@color/blackColor</item>
<item name="android:textColorTertiary">@color/blackColor</item>
<item name="android:windowBackground">@color/backgroundColor</item>
<item name="android:itemTextAppearance">@color/normalTextColor</item>
<item name="android:editTextBackground">@drawable/apptheme_edit_text_holo_light</item>
<item name="android:textColorHighlight">#99cea939</item>
<item name="android:textSelectHandleLeft">@drawable/apptheme_text_select_handle_left</item>
<item name="android:textSelectHandleRight">@drawable/apptheme_text_select_handle_right</item>
<item name="android:textSelectHandle">@drawable/apptheme_text_select_handle_middle</item>
<item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextViewAppTheme</item>
<item name="android:listChoiceIndicatorMultiple">@drawable/apptheme_btn_check_holo_light</item>
<item name="android:listChoiceIndicatorSingle">@drawable/apptheme_btn_radio_holo_light</item>
<item name="android:buttonStyle">@style/ButtonAppTheme</item>
<item name="android:imageButtonStyle">@style/ImageButtonAppTheme</item>
<item name="android:dropDownSpinnerStyle">@style/SpinnerAppTheme</item>
<item name="android:progressBarStyleHorizontal">@style/ProgressBarAppTheme</item>
<item name="android:seekBarStyle">@style/SeekBarAppTheme</item>
<item name="android:ratingBarStyle">@style/RatingBarAppTheme</item>
<item name="android:ratingBarStyleIndicator">@style/RatingBarBigAppTheme</item>
<item name="android:ratingBarStyleSmall">@style/RatingBarSmallAppTheme</item>
<item name="android:buttonStyleToggle">@style/ToggleAppTheme</item>
<item name="android:listChoiceBackgroundIndicator">@drawable/apptheme_list_selector_holo_light</item>
<item name="android:activatedBackgroundIndicator">@drawable/apptheme_activated_background_holo_light</item>
<item name="android:fastScrollThumbDrawable">@drawable/apptheme_fastscroll_thumb_holo</item>
</style>
<style name="SettingsToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorPrimary">@color/goldColor</item>
<item name="actionMenuTextColor">@color/abc_primary_text_material_light</item>
<item name="android:textColorSecondary">@color/goldColor</item>
</style>
<style name="Divider">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:background">?android:attr/listDivider</item>
</style>
<style name="AutoCompleteTextViewAppTheme" parent="android:Widget.Holo.Light.AutoCompleteTextView">
<item name="android:dropDownSelector">@drawable/apptheme_list_selector_holo_light</item>
<item name="android:background">@drawable/apptheme_edit_text_holo_light</item>
</style>
<style name="ButtonAppTheme" parent="android:Widget.Holo.Light.Button">
<item name="android:background">@drawable/apptheme_btn_default_holo_light</item>
</style>
<style name="ImageButtonAppTheme" parent="android:Widget.Holo.Light.ImageButton">
<item name="android:background">@drawable/apptheme_btn_default_holo_light</item>
</style>
<style name="SpinnerAppTheme" parent="android:Widget.Holo.Light.Spinner">
<item name="android:background">@drawable/apptheme_spinner_background_holo_light</item>
<item name="android:dropDownSelector">@drawable/apptheme_list_selector_holo_light</item>
</style>
<style name="TabAppTheme">
<item name="android:gravity">center_horizontal</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
<item name="android:background">@drawable/apptheme_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="TabTextAppTheme">
<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="ProgressBarAppTheme" parent="android:Widget.Holo.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/apptheme_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">@drawable/apptheme_progress_indeterminate_horizontal_holo_light</item>
</style>
<style name="SeekBarAppTheme" parent="android:Widget.Holo.Light.SeekBar">
<item name="android:progressDrawable">@drawable/apptheme_scrubber_progress_horizontal_holo_light</item>
<item name="android:indeterminateDrawable">@drawable/apptheme_scrubber_progress_horizontal_holo_light</item>
<item name="android:thumb">@drawable/apptheme_scrubber_control_selector_holo_light</item>
</style>
<style name="RatingBarAppTheme" parent="android:Widget.Holo.Light.RatingBar">
<item name="android:progressDrawable">@drawable/apptheme_ratingbar_full_holo_light</item>
<item name="android:indeterminateDrawable">@drawable/apptheme_ratingbar_full_holo_light</item>
</style>
<style name="RatingBarBigAppTheme" parent="android:Widget.Holo.Light.RatingBar.Indicator">
<item name="android:progressDrawable">@drawable/apptheme_ratingbar_holo_light</item>
<item name="android:indeterminateDrawable">@drawable/apptheme_ratingbar_holo_light</item>
</style>
<style name="RatingBarSmallAppTheme" parent="android:Widget.Holo.Light.RatingBar.Small">
<item name="android:progressDrawable">@drawable/apptheme_ratingbar_small_holo_light</item>
<item name="android:indeterminateDrawable">@drawable/apptheme_ratingbar_small_holo_light</item>
</style>
<style name="ToggleAppTheme" parent="android:Widget.Holo.Light.Button.Toggle">
<item name="android:background">@drawable/apptheme_btn_toggle_holo_light</item>
</style>
I would be very thankful to you for any help.
Background Color of menu / drop down / spinner
One of a few options:
Edit
styles.xml
Create
popup_menu.xml
under res/menu/ like this:Edit popupMenu in your
java-file
:enter image description here
add actionOverflowMenuStyle item to your app theme
You can simply add the line like this: