I want to make actionbardropdown and overflow menu transparent How can I do this?
I have tried
<style name="Theme.MyTheme" parent="#style/Theme.Sherlock.Light">
<item name="android:actionBarStyle">#style/myactionbar</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="actionDropDownStyle">#style/dropdown</item>
<item name="popupMenuStyle">#style/popupmenucolor</item>
<item name="actionBarStyle">#style/myactionbar</item>
<item name="dropDownListViewStyle">#style/dropdownlistview</item>
</style>
<style name="myactionbar" parent="#style/Widget.Sherlock.Light.ActionBar">
<item name="android:background">#android:color/transparent</item>
<item name="background">#android:color/transparent</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle</item>
</style>
<style name="ActionBarTabStyle" parent="#style/Widget.Sherlock.ActionBar.TabView">
<item name="background">#android:color/transparent</item>
<item name="android:background">#android:color/transparent</item>
</style>
<style name="dropdown" parent="#style/Widget.Sherlock.Light.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/transparent_background</item>
<item name="android:popupBackground">#drawable/dropdown</item>
<item name="android:dropDownSelector">#drawable/selectable_background_colors</item>
</style>
<style name="dropdownlistview" parent="#style/Widget.Sherlock.Light.ListView.DropDown">
<item name="android:listSelector">#drawable/dropdown</item>
</style>
<style name="popupmenucolor" parent="#style/Widget.Sherlock.Light.ListPopupWindow">
<item name="android:popupBackground">#drawable/dropdown</item>
</style>
here #drawable/dropdown is a 9 patch semi transparent image which has 30% opacity
But it does not make the dropdown transparent. How can I get this?
Thanks
Related
i am trying to change the design of an existing app with a new design given by client, the app is none but Q-Municate from Quickblox, the exisitng design is old and using ActionBar, i want to replace everything with the latest Material Design, Adding AppCompact v7 Lib 23,causes affect and errors to some other libraries , so i am using AppCompact v7 19
A Good tutorial or step by step guideline would be appreciated. Thanks in advance
I am pasting my styles.xml
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="android:actionModeStyle">#style/MyActionMode</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar" parent="android:Widget.ActionBar">
<item name="android:background">#color/action_bar_background_color</item>
<item name="android:displayOptions">showTitle</item>
<item name="android:titleTextStyle">#style/MyActionBarTitleText</item>
<item name="android:indeterminateProgressStyle">#style/IndeterminateProgressStyle</item>
</style>
<!-- ActionBar title body -->
<style name="MyActionBarTitleText" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
</style>
<style name="AppTheme.NoActionBar" parent="android:Theme.Holo.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
</style>
<style name="MyActionMode">
<item name="android:actionModeCloseDrawable">#drawable/badge_action_mode</item>
<item name="android:actionModeBackground">#drawable/badge_action_mode</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:titleTextStyle">#style/MyActionModeTitleText</item>
</style>
<style name="MyActionModeTitleText" parent="android:TextAppearance.Holo.Widget.ActionMode.Title">
<item name="android:textColor">#color/white</item>
</style>
<style name="baseToggleBtn">
<item name="android:textOff"></item>
<item name="android:textOn"></item>
</style>
<!-- EmojiTabs styles -->
<style name="EmojiTabImageButton" parent="android:Widget.ImageButton">
<item name="android:background">#drawable/tab_emoji_selector</item>
<item name="android:layout_width">0dip</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_weight">1</item>
</style>
<!-- Avatars ImageView style -->
<style name="AvatarImageView">
<item name="android:layout_width">#dimen/image_view_big_avatar_layout_width</item>
<item name="android:layout_height">#dimen/image_view_big_avatar_layout_height</item>
<item name="android:layout_gravity">center|top</item>
<item name="android:scaleType">centerCrop</item>
<item name="android:src">#drawable/placeholder_user</item>
</style>
<style name="IndeterminateProgressStyle" parent="#android:style/Widget.ProgressBar">
<item name="android:minHeight">24dp</item>
<item name="android:maxHeight">24dp</item>
<item name="android:minWidth">32dp</item>
<item name="android:maxWidth">32dp</item>
</style>
<style name="DoneCancelBar">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">#dimen/action_bar_height</item>
<item name="android:orientation">horizontal</item>
<item name="android:divider">#drawable/ic_action_divider</item>
<item name="android:showDividers" tools:ignore="NewApi">middle</item>
<item name="android:dividerPadding" tools:ignore="NewApi">12dp</item>
<item name="android:background">#color/action_button_bar</item>
</style>
<style name="ActionButton">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_weight">1</item>
<item name="android:background">#drawable/action_selectable_background</item>
</style>
<style name="ActionButtonText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center_vertical</item>
<item name="android:paddingRight">20dp</item>
<!-- Offsets left drawable -->
<item name="android:drawablePadding">8dp</item>
<item name="android:textColor">#color/action_button_text</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">13sp</item>
</style>
<style name="ActionButtonText.Done">
<item name="android:drawableLeft">#drawable/ic_action_done</item>
<item name="android:text">#string/dlg_done</item>
</style>
<style name="ActionButtonText.Cancel">
<item name="android:drawableLeft">#drawable/ic_action_cancel</item>
<item name="android:text">#string/dlg_cancel</item>
</style>
On the previsualicer of the mobile phone, you can choose the theme here and choose material (dark or light)
I'd like to remove shadow around my action bar overflow menu, but i haven't found any attributes allowing that. I'm extending Theme.AppCompat.
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
<!-- Customize your theme here. -->
<item name="actionOverflowButtonStyle">#style/OverflowButton</item>
<item name="actionOverflowMenuStyle">#style/OverflowMenu</item>
<item name="actionBarStyle">#style/MyActionBarLogo</item>
<item name="android:dropDownListViewStyle">#style/PopupMenuListView</item>
<item name="dropDownListViewStyle">#style/PopupMenuListView</item>
<item name="android:textColor">#color/black</item>
<item name="android:popupMenuStyle">#style/PopupMenu</item>
</style>
<style name="MyActionBarLogo" parent="Widget.AppCompat.ActionBar">
<item name="background">#color/white</item>
<item name="displayOptions">useLogo|showHome</item>
<item name="elevation">0dp</item>
<item name="android:windowContentOverlay">#null</item>
</style>
<style name="OverflowButton" parent="#style/Widget.AppCompat.ActionButton.Overflow">
<item name="android:src">#mipmap/menu_logo</item>
</style>
<style name="OverflowMenu" parent="#style/Widget.AppCompat.PopupMenu.Overflow">
<item name="overlapAnchor">false</item>
<item name="android:dropDownVerticalOffset">52dp</item>
<item name="android:dropDownHorizontalOffset">10dp</item>
</style>
<style name="PopupMenuListView" parent="#style/Widget.AppCompat.ListView.DropDown">
<item name="android:divider">#drawable/menu_divider</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:textColor">#color/black</item>
<item name="android:background">#color/white</item>
</style>
<style name="PopupMenu" parent="#style/Widget.AppCompat.ListPopupWindow">
<item name="android:popupBackground">#color/white</item>
</style>
http://imgur.com/5mbceT9
You can try solution this
getSupportActionBar().setElevation(0);
UPDATE
<style name="MyActionBarLogo" parent="Widget.AppCompat.ActionBar">
<item name="background">#color/white</item>
<item name="displayOptions">useLogo|showHome</item>
<item name="elevation">0dp</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:actionDropDownStyle">#style/DropDownMenuStyle</item>
</style>
<style name="DropDownMenuStyle" parent="Widget.AppCompat.Spinner.DropDown.ActionBar">
<item name="android:background">#android:color/transparent</item>
</style>
You need to apply the zero elevation style to the correct element, in this case actionOverflowMenuStyle.
(This is using appcompat)
<style name="Theme.myapp" parent="Theme.AppCompat.Light">
<item name="actionOverflowMenuStyle">#style/Theme.myapp.Widget.PopupMenu.Overflow</item>
</style>
Then
<style name="Theme.myapp.Widget.PopupMenu.Overflow" parent="Widget.AppCompat.PopupMenu.Overflow">
<item name="elevation">0dp</item>
<item name="android:popupElevation">0dp</item>
</style>
I have a problem with my holo theme, it works right until Android 4.4 but when i run the same app in Android 5.0+ the dropdown menu for overflow items in the actionbar show the TEXT in color Black, i need the color WHITE
ANY IDEAS?
<style name="Theme.Flux" parent="#android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarItemBackground">#drawable/selectable_background_flux</item>
<item name="android:popupMenuStyle">#style/PopupMenu.Flux</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Flux</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle.Flux</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.Flux</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid.Flux</item>
<item name="android:actionModeBackground">#drawable/cab_background_top_flux</item>
<item name="android:actionModeSplitBackground">#drawable/cab_background_bottom_flux</item>
<item name="android:actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Flux</item>
<!-- Light.DarkActionBar specific -->
<item name="android:actionBarWidgetTheme">#style/Theme.Flux.Widget</item>
<item name="android:actionMenuTextColor">#android:color/white</item>
<item name="actionMenuTextColor">#android:color/white</item>
</style>
<style name="ActionBar.Solid.Flux" parent="#android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
<item name="android:background">#drawable/ab_solid_flux</item>
<item name="android:backgroundStacked">#drawable/ab_stacked_solid_flux</item>
<item name="android:backgroundSplit">#drawable/ab_bottom_solid_flux</item>
<item name="android:progressBarStyle">#style/ProgressBar.Flux</item>
<item name="android:textColor">#android:color/white</item>
<item name="android:actionMenuTextColor">#android:color/white</item>
<item name="actionMenuTextColor">#android:color/white</item>
<item name="android:titleTextStyle">#style/TitleColor</item>
</style>
<style name="TitleColor" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#android:color/white</item>
</style>
<style name="ActionBar.Transparent.Flux" parent="#android:style/Widget.Holo.ActionBar">
<item name="android:background">#drawable/ab_transparent_flux</item>
<item name="android:progressBarStyle">#style/ProgressBar.Flux</item>
</style>
<style name="PopupMenu.Flux" parent="#android:style/Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_flux</item>
</style>
<style name="DropDownListView.Flux" parent="#android:style/Widget.Holo.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_flux</item>
</style>
<style name="ActionBarTabStyle.Flux" parent="#android:style/Widget.Holo.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_flux</item>
</style>
<style name="DropDownNav.Flux" parent="#android:style/Widget.Holo.Spinner">
<item name="android:background">#drawable/spinner_background_ab_flux</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_flux</item>
<item name="android:dropDownSelector">#drawable/selectable_background_flux</item>
</style>
<style name="ProgressBar.Flux" parent="#android:style/Widget.Holo.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_flux</item>
</style>
<style name="ActionButton.CloseMode.Flux" parent="#android:style/Widget.Holo.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_flux</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Flux.Widget" parent="#android:style/Theme.Holo">
<item name="android:popupMenuStyle">#style/PopupMenu.Flux</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Flux</item>
</style>
<style name="menu_labels_style">
<item name="android:background">#drawable/fab_label_background</item>
<item name="android:textColor">#android:color/white</item>
<item name="android:actionMenuTextColor">#android:color/white</item>
</style>
Change the style file also in values-v11 and values-v14 folders
i solve my problem when i put my style file in values-v11 and values-v14 folders i also add this style to my main style.
<item name="android:itemTextAppearance">#style/TextAppearance</item>
this is my style
<style name="Theme.Flux" parent="#android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarItemBackground">#drawable/selectable_background_flux</item>
<item name="android:popupMenuStyle">#style/PopupMenu.Flux</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Flux</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle.Flux</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.Flux</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid.Flux</item>
<item name="android:actionModeBackground">#drawable/cab_background_top_flux</item>
<item name="android:actionModeSplitBackground">#drawable/cab_background_bottom_flux</item>
<item name="android:actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Flux</item>
<!-- Light.DarkActionBar specific -->
<item name="android:actionBarWidgetTheme">#style/Theme.Flux.Widget</item>
<item name="android:itemTextAppearance">#style/TextAppearance</item>
<item name="android:actionMenuTextColor">#android:color/white</item>
</style>
<style name="TextAppearance">
<item name="android:textColor">#android:color/white</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.
I am using Theme.Holo in My Current android app.
Above is the overflow UI from my current theme.
I want to customize overflow menu's background color to RGB (245, 243, 239), and the font color to RGB (64, 64, 64).
Following is the style.xml I am using
<style name="CustomActivityTheme" parent="#android:style/Theme.Holo">
<item name="android:actionBarStyle">#style/CustomActivityTheme.ActionBar</item>
<item name="android:actionMenuTextColor">#000000</item>
<item name="android:divider">#drawable/action_bar_div</item>
<item name="android:actionOverflowButtonStyle">#style/MyActionButtonOverflow</item>
</style>
<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">#drawable/overflow</item>
</style>
<style name="CustomActivityTheme.ActionBar" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#drawable/actionbar_bg</item>
<item name="android:titleTextStyle">#style/CustomActivityTheme.ActionBar.Text</item>
<item name="android:subtitleTextStyle">#style/CustomActivityTheme.ActionBar.Text</item>
</style>
<style name="CustomActivityTheme.ActionBar.Text" parent="#android:style/TextAppearance">
<item name="android:textColor">#000000</item>
<item name="android:textSize">16sp</item>
</style>
<style name="activated" parent="android:Theme.Holo">
<item name="android:background">?android:attr/activatedBackgroundIndicator</item>
</style>
<!-- style for removing the floating dialog -->
<style name="CustomDialogTheme">
<item name="android:windowIsFloating">false</item>
<item name="android:windowNoTitle">true</item>
</style>
<!-- style for transparent image resource activity -->
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowAnimationStyle">#style/MyAnimation.Window</item>
</style>
<!-- Animations for a non-full-screen window or activity. -->
<style name="MyAnimation.Window" parent="#android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">#anim/grow_from_middle</item>
<item name="android:windowExitAnimation">#anim/shrink_to_middle</item>
</style>
<!-- style for transparent audio and video resource activity -->
<style name="Theme.Transparent_Player" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowAnimationStyle">#style/MyPlayerAnimation.Window</item>
</style>
<!-- Animations for a non-full-screen window or activity. -->
<style name="MyPlayerAnimation.Window" parent="#android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">#anim/grow_from_action_bar</item>
<item name="android:windowExitAnimation">#anim/shrink_to_action_bar</item>
</style>
How can I customize theme to match overflow menu's background color to RGB (245, 243, 239), and the font color to RGB (64, 64, 64) in above code?
Thanks in advance..
to change text color you can use :
<item name="android:textAppearanceLargePopupMenu" >#style/m_textAppearanceLargePopupMenu</item>
<item name="android:textAppearanceSmallPopupMenu" >#style/m_textAppearanceSmallPopupMenu</item>
<style name="m_textAppearanceLargePopupMenu" parent="#android:style/TextAppearance.Holo.Widget.PopupMenu.Large">
<item name="android:textColor">#FFF</item>
</style>
<style name="m_textAppearanceSmallPopupMenu" parent="#android:style/TextAppearance.Holo.Widget.PopupMenu.Small">
<item name="android:textColor">#FFF</item>
</style>
this will change the popup menu text color to white
Try this:
<style name="CustomActivityTheme" parent="#android:style/Theme.Holo">
...
<item name="android:popupMenuStyle">#style/MyPopupMenu</item>
...
</style>
<style name="MyPopupMenu" parent="android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:background">#f5fdef</item>
</style>
I found it at this post
<style name="MyActionBar3" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="android:background">#color/ActionBarBackground</item>
</style>
<style name="MyActionBarDropDownStyle" parent="">
<item name="android:background">#00FF00</item>
<item name="android:divider">#ff0000</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:textColor">#FFFFFF</item>
<item name="android:textSize">10sp</item>
</style>
<style name="MyTextStyle" parent="#style/Widget.AppCompat.Light.Base.ListPopupWindow">
<item name="android:popupBackground">#FF0000</item>
</style>
Apply the style to android:textAppearanceLargePopupMenu" item's attribute