AppCompat Title color - android

I'm having some troubles changing the color for the ActionBar. I'm using AppCompat library for support. Everything else works: like background, or selector ... but the title color isn't changing.
This is my style file:
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.Customtitletheme" parent="#style/Theme.AppCompat.Light">
<item name="actionBarItemBackground">#drawable/selectable_background_customtitletheme</item>
<item name="android:actionBarItemBackground" tools:targetApi="14">#drawable/selectable_background_customtitletheme</item>
<item name="popupMenuStyle">#style/PopupMenu.Customtitletheme</item>
<item name="android:popupMenuStyle" tools:targetApi="11">#style/PopupMenu.Customtitletheme</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Customtitletheme</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Customtitletheme</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle.Customtitletheme</item>
<item name="android:actionBarTabStyle" tools:targetApi="11">#style/ActionBarTabStyle.Customtitletheme</item>
<item name="actionDropDownStyle">#style/DropDownNav.Customtitletheme</item>
<item name="android:actionDropDownStyle" tools:targetApi="11">#style/DropDownNav.Customtitletheme</item>
<item name="actionBarStyle">#style/ActionBar.Solid.Customtitletheme</item>
<item name="android:actionBarStyle" tools:targetApi="11">#style/ActionBar.Solid.Customtitletheme</item>
<item name="actionModeBackground">#drawable/cab_background_top_customtitletheme</item>
<item name="android:actionModeBackground" tools:targetApi="11">#drawable/cab_background_top_customtitletheme</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_customtitletheme</item>
<item name="android:actionModeSplitBackground" tools:targetApi="14">#drawable/cab_background_bottom_customtitletheme</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Customtitletheme</item>
<item name="android:actionModeCloseButtonStyle" tools:targetApi="11">#style/ActionButton.CloseMode.Customtitletheme</item>
<item name="actionMenuTextColor">#color/actionbar_text</item>
<item name="android:actionMenuTextColor" tools:targetApi="11">#color/actionbar_text</item>
</style>
<style name="ActionBar.Solid.Customtitletheme" parent="#style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">#drawable/ab_solid_customtitletheme</item>
<item name="android:background">#drawable/ab_background_textured_customtitletheme</item>
<item name="backgroundStacked">#drawable/ab_stacked_solid_customtitletheme</item>
<item name="android:backgroundStacked" tools:targetApi="14">#drawable/ab_stacked_solid_customtitletheme</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_customtitletheme</item>
<item name="android:backgroundSplit" tools:targetApi="14">#drawable/ab_background_textured_customtitletheme</item>
<item name="progressBarStyle">#style/ProgressBar.Customtitletheme</item>
<item name="android:progressBarStyle">#style/ProgressBar.Customtitletheme</item>
<item name="titleTextStyle">#style/ActionBar.CustomTitle</item>
<item name="android:textStyle">#style/ActionBar.CustomTitle</item>
</style>
<style name="PopupMenu.Customtitletheme" parent="#style/Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_customtitletheme</item>
</style>
<style name="DropDownListView.Customtitletheme" parent="#style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_customtitletheme</item>
</style>
<style name="ActionBarTabStyle.Customtitletheme" parent="#style/Widget.AppCompat.Light.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_customtitletheme</item>
</style>
<style name="DropDownNav.Customtitletheme" parent="#style/Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/spinner_background_ab_customtitletheme</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_customtitletheme</item>
<item name="android:dropDownSelector">#drawable/selectable_background_customtitletheme</item>
</style>
<style name="ProgressBar.Customtitletheme" parent="#style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_customtitletheme</item>
</style>
<style name="ActionButton.CloseMode.Customtitletheme" parent="#style/Widget.AppCompat.Light.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_customtitletheme</item>
</style>
<!-- ActionBar title text -->
<style name="ActionBar.CustomTitle" parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/actionbar_text</item>
<!-- The textColor property is backward compatible with the Support Library -->
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Customtitletheme.Widget" parent="#style/Theme.AppCompat">
<item name="popupMenuStyle">#style/PopupMenu.Customtitletheme</item>
<item name="android:popupMenuStyle" tools:targetApi="11">#style/PopupMenu.Customtitletheme</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Customtitletheme</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Customtitletheme</item>
</style>
</resources>
I have also used different values folders, like values-v14 or values-v11, but the same result.
If I change the parent from "Theme.AppCompat.Light" to "Theme.AppCompat.Dark" the color changes, but when I want to use some custom color it is not working...
Also, this is how I used the specified theme in manifest:
<activity
android:name="com.cos.ShareActivity"
android:label="Share File"
android:parentActivityName="com.cos.FileManagerActivity"
android:theme="#style/Theme.Customtitletheme" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.cos.FileManagerActivity" />
</activity>
What I am doing wrong that the color item is ignored ?

After so much time lost trying to figure it out, I found that it was a typo ... damn ... I have used android:textStyle instead of android:titleTextStyle. When I typed in that line the IDE auto-suggest typed the first one :(

Related

How do I customize menu item's background color?

I'm trying to customize Toolbar's popup menu. Now I can not set background color of menu item.
My styles.xml looks like this:
<resources>
<!-- Base application theme. -->
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:actionBarStyle">#style/AppTheme.ActionBar</item>
<item name="android:actionMenuTextColor">#color/actionbar_text_color</item>
<item name="android:dropDownListViewStyle">#style/AppTheme.DropDown</item>
<item name="android:itemTextAppearance">#style/menuItemColor</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">#style/AppTheme.ActionBar</item>
<item name="actionMenuTextColor">#color/actionbar_text_color</item>
<item name="dropDownListViewStyle">#style/AppTheme.DropDown</item>
<item name="itemTextAppearance">#style/menuItemColor</item>
</style>
<style name="AppTheme.ActionBar" parent="#style/ThemeOverlay.AppCompat.Dark.ActionBar">\
<item name="titleTextColor">#color/actionbar_text_color</item>
<item name="subtitleTextColor">#color/actionbar_text_color</item>
<item name="android:background">#color/actionbar_background</item>
<!-- Support library compatibility -->
<item name="background">#color/actionbar_background</item>
</style>
<style name="AppTheme.DropDown" parent="#style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:background">#color/background_color</item>
<!-- Support library compatibility -->
<item name="background">#color/background_color</item>
</style>
<style name="menuItemColor">
<item name="android:textColor">#color/inactive_text_color</item>
</style>
</resources>
I added ActionBar to activity layout with code
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:theme="#style/AppTheme.ActionBar"/>
Note: I'm using AppCompat, not Holo or other.
This may help you,create a style like,
<style name="PopupMenu" parent="#android:style/Widget.PopupMenu">
<item name="android:popupBackground">#android:color/white</item>
and add it to your main themes..
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:popupMenuStyle">#style/PopupMenu</item> <! added it here
<item name="android:actionBarStyle">#style/AppTheme.ActionBar</item>
<item name="android:actionMenuTextColor">#color/actionbar_text_color</item>
<item name="android:textColor">#color/text_color</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">#style/AppTheme.ActionBar</item>
<item name="actionMenuTextColor">#color/actionbar_text_color</item>
</style>
<style name="AppTheme.ActionBar" parent="#style/ThemeOverlay.AppCompat.Dark.ActionBar">\
<item name="titleTextColor">#color/actionbar_text_color</item>
<item name="subtitleTextColor">#color/actionbar_text_color</item>
<item name="android:popupMenuStyle">#style/PopupMenu</item> <! added it here
<item name="android:background">#color/actionbar_background</item>
<!-- Support library compatibility -->
<item name="background">#color/actionbar_background</item>
</style>
You have to define style for Overflow Menu too like this :
<!-- OverFlow menu Styles -->
<style name="PopupMenuListView" parent="#style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:divider">#color/sp_red_500</item>
<item name="android:dividerHeight">1dp</item>
<item name="android:background">#color/white</item>
</style>
and in your parent theme style( Base application theme.) define drop down menu style like this :
<item name="dropDownListViewStyle">#style/PopupMenuListView</item>

Changing Color of Tab Text in ActionBarActivity

I have an app using the support ActionBarActivity (android.support.v7.app.ActionBarActivity), with tabs. I used the Action Bar Style Generator to change the look of the app, but now I am having a hard time getting the tab text color to change.
The style is being applied through the manifest, and shows up just fine except for the tab text color remains black no matter what I try. Here's what I have in my custom styles xml file right now:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.StyledActionBar" parent="#style/Theme.AppCompat.Light">
<item name="actionBarItemBackground">#drawable/selectable_background_StyledActionBar</item>
<item name="popupMenuStyle">#style/PopupMenu.StyledActionBar</item>
<item name="dropDownListViewStyle">#style/DropDownListView.StyledActionBar</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle.StyledActionBar</item>
<item name="actionDropDownStyle">#style/DropDownNav.StyledActionBar</item>
<item name="actionBarStyle">#style/ActionBar.Solid.StyledActionBar</item>
<item name="actionModeBackground">#drawable/cab_background_top_StyledActionBar</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_StyledActionBar</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode.StyledActionBar</item>
<item name="actionBarTabTextStyle">#style/TabTextStyle</item>
<item name="android:actionBarTabTextStyle">#style/TabTextStyle</item>
</style>
<style name="TabTextStyle" parent="#style/Widget.AppCompat.ActionBar.TabText">
<item name="android:textColor">#android:color/white</item>
</style>
<style name="ActionBar.Solid.StyledActionBar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">#drawable/ab_solid_StyledActionBar</item>
<item name="backgroundStacked">#drawable/ab_stacked_solid_StyledActionBar</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_StyledActionBar</item>
<item name="progressBarStyle">#style/ProgressBar.StyledActionBar</item>
</style>
<style name="ActionBar.Transparent.StyledActionBar" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="background">#drawable/ab_transparent_StyledActionBar</item>
<item name="progressBarStyle">#style/ProgressBar.StyledActionBar</item>
</style>
<style name="PopupMenu.StyledActionBar" parent="#style/Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_StyledActionBar</item>
</style>
<style name="DropDownListView.StyledActionBar" parent="#style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_StyledActionBar</item>
</style>
<style name="ActionBarTabStyle.StyledActionBar" parent="#style/Widget.AppCompat.Light.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_StyledActionBar</item>
</style>
<style name="DropDownNav.StyledActionBar" parent="#style/Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/spinner_background_ab_StyledActionBar</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_StyledActionBar</item>
<item name="android:dropDownSelector">#drawable/selectable_background_StyledActionBar</item>
</style>
<style name="ProgressBar.StyledActionBar" parent="#style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_StyledActionBar</item>
</style>
<style name="ActionButton.CloseMode.StyledActionBar" parent="#style/Widget.AppCompat.Light.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_StyledActionBar</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.StyledActionBar.Widget" parent="#style/Theme.AppCompat">
<item name="popupMenuStyle">#style/PopupMenu.StyledActionBar</item>
<item name="dropDownListViewStyle">#style/DropDownListView.StyledActionBar</item>
</style>
</resources>
As you can see, I tried to change the color to white, but to no effect. I also was trying to change the Action Bar title color, but gave up because I found a java workaround.
ActionBarActivity is deprecated.
And you are using Theme.AppCompat : ActionBarActivity is deprecated
Try to use AppCompatActivity in your java codes(Activity).

AppCompat Custom theme not applying

I generated a custom theme using the Android Asset Studio Actionbar styling tool. I am not able to view the theme. I only get the AppCompat.Light or AppCompat.Light.DarkActionBar base theme in my app. (I also referred to this article Theme not applied using appcompat library on some Android 4.X devices)
My values/styles.xml
<style name="Theme.Betbuds" parent="#style/Theme.AppCompat.Light">
<item name="actionBarItemBackground">#drawable/selectable_background_betbuds</item>
<item name="popupMenuStyle">#style/PopupMenu.Betbuds</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Betbuds</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle.Betbuds</item>
<item name="actionDropDownStyle">#style/DropDownNav.Betbuds</item>
<item name="actionBarStyle">#style/ActionBar.Solid.Betbuds</item>
<item name="actionModeBackground">#drawable/cab_background_top_betbuds</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_betbuds</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Betbuds</item>
</style>
<style name="ActionBar.Solid.Betbuds" parent="#style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">#drawable/ab_solid_betbuds</item>
<item name="backgroundStacked">#drawable/ab_stacked_solid_betbuds</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_betbuds</item>
<item name="progressBarStyle">#style/ProgressBar.Betbuds</item>
</style>
<style name="ActionBar.Transparent.Betbuds" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="background">#drawable/ab_transparent_betbuds</item>
<item name="progressBarStyle">#style/ProgressBar.Betbuds</item>
</style>
<style name="PopupMenu.Betbuds" parent="#style/Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_betbuds</item>
</style>
<style name="DropDownListView.Betbuds" parent="#style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_betbuds</item>
</style>
<style name="ActionBarTabStyle.Betbuds" parent="#style/Widget.AppCompat.Light.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_betbuds</item>
</style>
<style name="DropDownNav.Betbuds" parent="#style/Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/spinner_background_ab_betbuds</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_betbuds</item>
<item name="android:dropDownSelector">#drawable/selectable_background_betbuds</item>
</style>
<style name="ProgressBar.Betbuds" parent="#style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_betbuds</item>
</style>
<style name="ActionButton.CloseMode.Betbuds" parent="#style/Widget.AppCompat.Light.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_betbuds</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Betbuds.Widget" parent="#style/Theme.AppCompat">
<item name="popupMenuStyle">#style/PopupMenu.Betbuds</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Betbuds</item>
</style>
My values-v14/styles.xml
<style name="Theme.Betbuds" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarItemBackground">#drawable/selectable_background_betbuds</item>
<item name="android:popupMenuStyle">#style/PopupMenu.Betbuds</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Betbuds</item>
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle.Betbuds</item>
<item name="android:actionDropDownStyle">#style/DropDownNav.Betbuds</item>
<item name="android:actionBarStyle">#style/ActionBar.Solid.Betbuds</item>
<item name="android:actionModeBackground">#drawable/cab_background_top_betbuds</item>
<item name="android:actionModeSplitBackground">#drawable/cab_background_bottom_betbuds</item>
<item name="android:actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Betbuds</item>
</style>
<style name="ActionBar.Solid.Betbuds" parent="#style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="android:background">#drawable/ab_solid_betbuds</item>
<item name="android:backgroundStacked">#drawable/ab_stacked_solid_betbuds</item>
<item name="android:backgroundSplit">#drawable/ab_solid_betbuds</item>
<item name="android:progressBarStyle">#style/ProgressBar.Betbuds</item>
</style>
<style name="ActionBar.Transparent.Betbuds" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="android:background">#drawable/ab_transparent_betbuds</item>
<item name="android:progressBarStyle">#style/ProgressBar.Betbuds</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Betbuds.Widget" parent="#style/Theme.AppCompat">
<item name="android:popupMenuStyle">#style/PopupMenu.Betbuds</item>
<item name="android:dropDownListViewStyle">#style/DropDownListView.Betbuds</item>
</style>
</resources>
The Android Studio preview also shows only the Base themes. I have the following in my Manifest
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Betbuds" >
I realise that there are a lot of questions similar to this. I am not able to figure out an answer. Any help is appreciated. Thanks.

Change generated action bar theme from Android Asset Studio

I have used Android Asset Studio to generate action bar style, however i woul like to do some changes, which I was unable to do in Studio, so I edited generated theme but lot of things was just ignored, and I just can't figure out how things work.
There is example:
`
<style name="Theme.Myactionbar" parent="#style/Theme.AppCompat.Light">
<item name="actionBarItemBackground">#drawable/selectable_background_myactionbar</item>
<item name="popupMenuStyle">#style/PopupMenu.Myactionbar</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Myactionbar</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle.Myactionbar</item>
<item name="actionDropDownStyle">#style/DropDownNav.Myactionbar</item>
<item name="actionBarStyle">#style/ActionBar.Solid.Myactionbar</item>
<item name="actionModeBackground">#drawable/cab_background_top_myactionbar</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_myactionbar</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Myactionbar</item>
</style>
<style name="ActionBar.Solid.Myactionbar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">#drawable/ab_solid_myactionbar</item> //THIS IS GREEN
<item name="backgroundStacked">#drawable/ab_solid_myactionbar</item>//THIS IS GREEN
<item name="backgroundSplit">#drawable/ab_bottom_solid_myactionbar</item>//THIS IS GREEN
<item name="progressBarStyle">#style/ProgressBar.Myactionbar</item>
</style>
<style name="ActionBar.Transparent.Myactionbar" parent="#style/Widget.AppCompat.Light.ActionBar">
<item name="background">#drawable/ab_transparent_myactionbar</item>
<item name="progressBarStyle">#style/ProgressBar.Myactionbar</item>
</style>
<style name="PopupMenu.Myactionbar" parent="#style/Widget.AppCompat.Light.PopupMenu">
<item name="android:popupBackground">#drawable/menu_dropdown_panel_example </item>
</style>
<style name="DropDownListView.Myactionbar" parent="#style/Widget.AppCompat.Light.ListView.DropDown">
<item name="android:listSelector">#drawable/selectable_background_myactionbar</item>
</style>
<style name="ActionBarTabStyle.Myactionbar" parent="#style/Widget.AppCompat.Light.ActionBar.TabView">
<item name="android:background">#drawable/tab_indicator_ab_myactionbar</item>
</style>
<style name="DropDownNav.Myactionbar" parent="#style/Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
<item name="android:background">#drawable/spinner_background_ab_myactionbar</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_myactionbar</item>
<item name="android:dropDownSelector">#drawable/selectable_background_myactionbar</item>
</style>
<style name="ProgressBar.Myactionbar" parent="#style/Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:progressDrawable">#drawable/progress_horizontal_myactionbar</item>
</style>
<style name="ActionButton.CloseMode.Myactionbar" parent="#style/Widget.AppCompat.Light.ActionButton.CloseMode">
<item name="android:background">#drawable/btn_cab_done_myactionbar</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Myactionbar.Widget" parent="#style/Theme.AppCompat">
<item name="popupMenuStyle">#style/PopupMenu.Myactionbar</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Myactionbar</item>
</style>
Everything was like in generator, but then i tried the simplest change, that is the color, so I edited style name=ActionBar.Solid.Myactionbar and put there som other drawables from other generated style.
It looked like this :
<style name="Theme.Myactionbar" parent="#style/Theme.AppCompat.Light">
<item name="actionBarItemBackground">#drawable/selectable_background_myactionbar</item>
<item name="popupMenuStyle">#style/PopupMenu.Myactionbar</item>
<item name="dropDownListViewStyle">#style/DropDownListView.Myactionbar</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle.Myactionbar</item>
<item name="actionDropDownStyle">#style/DropDownNav.Myactionbar</item>
<item name="actionBarStyle">#style/ActionBar.Solid.Myactionbar</item>
<item name="actionModeBackground">#drawable/cab_background_top_myactionbar</item>
<item name="actionModeSplitBackground">#drawable/cab_background_bottom_myactionbar</item>
<item name="actionModeCloseButtonStyle">#style/ActionButton.CloseMode.Myactionbar</item>
</style>
<style name="ActionBar.Solid.Myactionbar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid">
<item name="background">#drawable/ab_solid_example</item>
<item name="backgroundStacked">#drawable/ab_stacked_solid_example</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_myactionbar</item>
<item name="progressBarStyle">#style/ProgressBar.Myactionbar</item>
</style>
but nothing happend, and changed drawables supposed to be gray. I was wandering if anybody did this before and why this isnt working? Thank you
Ok I figured it out, there is values-v14 folder for styles for api level 14 and above, so you have to change these values too.

Sherlock + DeviceDefault

Could one use Action Bar Sherlock together with the DeviceDefault theme (on >4.2), and with the regular Theme (as it used to be on <3.0)?
The pointe is of course that I suspect Sherlock forces you to use its own themes (some of which are based on Holo).
In values/themes.xml:
<style name="Theme.MyApp" extends="Theme.Sherlock">
</style>
In values-v14/themes.xml:
<style name="Theme.MyApp" extends="android:Theme.DeviceDefault">
</style>
And then use Theme.MyApp in your manifest.
Actually the Sherlock.Holo theme just applies the holo theme to the ActionBar. As you can see from the Sherlock.Theme for APIs below 11:
<style name="Theme.Sherlock" parent="Sherlock.__Theme">
<!-- Action bar styles (from Theme.Holo) -->
<item name="actionDropDownStyle">#style/Widget.Sherlock.Spinner.DropDown.ActionBar</item>
<item name="actionButtonStyle">#style/Widget.Sherlock.ActionButton</item>
<item name="actionOverflowButtonStyle">#style/Widget.Sherlock.ActionButton.Overflow</item>
<item name="actionModeBackground">#drawable/abs__cab_background_top_holo_dark</item>
<item name="actionModeSplitBackground">#drawable/abs__cab_background_bottom_holo_dark</item>
<item name="actionModeCloseDrawable">#drawable/abs__ic_cab_done_holo_dark</item>
<item name="actionBarTabStyle">#style/Widget.Sherlock.ActionBar.TabView</item>
<item name="actionBarTabBarStyle">#style/Widget.Sherlock.ActionBar.TabBar</item>
<item name="actionBarTabTextStyle">#style/Widget.Sherlock.ActionBar.TabText</item>
<item name="actionModeStyle">#style/Widget.Sherlock.ActionMode</item>
<item name="actionModeCloseButtonStyle">#style/Widget.Sherlock.ActionButton.CloseMode</item>
<item name="actionBarStyle">#style/Widget.Sherlock.ActionBar</item>
<item name="actionBarSize">#dimen/abs__action_bar_default_height</item>
<!-- Internal --><item name="actionModePopupWindowStyle">#style/Widget.Sherlock.PopupWindow.ActionMode</item>
<item name="actionBarWidgetTheme">#null</item>
<!-- Action bar styles (defaults from Theme) -->
<item name="actionBarSplitStyle">?attr/actionBarStyle</item>
<item name="actionMenuTextAppearance">#style/TextAppearance.Sherlock.Widget.ActionBar.Menu</item>
<item name="actionMenuTextColor">?attr/textColorPrimary</item>
<item name="actionBarDivider">?attr/dividerVertical</item>
<item name="actionBarItemBackground">?attr/selectableItemBackground</item>
<item name="buttonStyleSmall">#style/Widget.Sherlock.Button.Small</item>
<item name="selectableItemBackground">#drawable/abs__item_background_holo_dark</item>
<item name="activatedBackgroundIndicator">#drawable/abs__activated_background_holo_dark</item>
<item name="actionModeShareDrawable">#drawable/abs__ic_menu_share_holo_dark</item>
<item name="activityChooserViewStyle">#style/Widget.Sherlock.ActivityChooserView</item>
<item name="homeAsUpIndicator">#drawable/abs__ic_ab_back_holo_dark</item>
<item name="dividerVertical">#drawable/abs__list_divider_holo_dark</item>
<item name="spinnerDropDownItemStyle">#style/Widget.Sherlock.DropDownItem.Spinner</item>
<item name="spinnerItemStyle">#style/Widget.Sherlock.TextView.SpinnerItem</item>
<item name="textColorPrimary">#color/abs__primary_text_holo_dark</item>
<item name="textColorPrimaryDisableOnly">#color/abs__primary_text_disable_only_holo_dark</item>
<item name="textColorPrimaryInverse">#color/abs__primary_text_holo_light</item>
<!-- Internal --><item name="dropdownListPreferredItemHeight">48dip</item>
<item name="dropDownListViewStyle">#style/Widget.Sherlock.ListView.DropDown</item>
<item name="textAppearanceSmall">#style/TextAppearance.Sherlock.Small</item>
<item name="textAppearanceLargePopupMenu">#style/TextAppearance.Sherlock.Widget.PopupMenu.Large</item>
<item name="textAppearanceSmallPopupMenu">#style/TextAppearance.Sherlock.Widget.PopupMenu.Small</item>
<item name="popupMenuStyle">#style/Widget.Sherlock.PopupMenu</item>
<!-- Internal --><item name="listPopupWindowStyle">#style/Widget.Sherlock.ListPopupWindow</item>
<item name="searchDropdownBackground">#drawable/abs__search_dropdown_dark</item>
<item name="searchViewTextField">#drawable/abs__textfield_searchview_holo_dark</item>
<item name="searchViewTextFieldRight">#drawable/abs__textfield_searchview_right_holo_dark</item>
<item name="searchViewCloseIcon">#drawable/abs__ic_clear</item>
<item name="searchViewSearchIcon">#drawable/abs__ic_search</item>
<item name="searchViewGoIcon">#drawable/abs__ic_go</item>
<item name="searchViewVoiceIcon">#drawable/abs__ic_voice_search</item>
<item name="searchAutoCompleteTextView">#style/Widget.Sherlock.SearchAutoCompleteTextView</item>
<item name="android:dropDownHintAppearance">#style/TextAppearance.Sherlock.Widget.DropDownHint</item>
<item name="windowActionBar">true</item>
<item name="windowActionModeOverlay">false</item>
<item name="windowContentOverlay">#null</item>
</style>
There is no TextViewStyle or any other styling specified other than for the ActionBar, so you don't need to modify the theme.
All other stylings are done by the parent theme Sherlock.__Theme as you can see. And this Theme is basically just the NoTitleBar theme on APIs below 11.
<style name="Sherlock.__Theme" parent="android:Theme.NoTitleBar">
<item name="android:windowContentOverlay">#null</item>
</style>
So this won't override any other styles.

Categories

Resources