Sherlock + DeviceDefault - android

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.

Related

Overriding Style XML for Component

im using Material IO and i want to Change the Text-Color of my Menu.
<resources>
...
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
...
<item name="android:textColorPrimary">#color/colorText</item>
</style>
...
<resources>
Does exactly that. But it changes every Text Color. But i just want to Change the Color of my Menu-Text.
So i tried to change only that:
<style name="ActionBarTheme" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:textColor">#color/colorMenuText</item> //android.view
<item name="android:textColorPrimary">#color/colorMenuText</item>
<item name="android:actionMenuTextAppearance">#color/colorWhite</item>
<item name="android:background">#color/colorAccent</item>
<item name="popupTheme">#style/ActionBarPopupTheme</item>
<!-- backward compatibility -->
<item name="background">#color/colorAccent</item>
</style>
by writing some Thing like This.
I can change the Menu-Background this way, but i cant change the Menu-Text-Color this way. I tried everything i found on Stackoverflow but i couldnt fix this issue.
Whole Styles.xml
<resources>
<style name="ActionBarTheme" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:textColor">#color/colorMenuText</item> //android.view
<item name="android:textColorPrimary">#color/colorMenuText</item>
<item name="android:actionMenuTextAppearance">#color/colorWhite</item>
<item name="android:background">#color/colorAccent</item>
<item name="popupTheme">#style/ActionBarPopupTheme</item>
<!-- backward compatibility -->
<item name="background">#color/colorAccent</item>
</style>
<style name="AlertDialogCustom" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:colorAccent">#0000FF</item>
</style>
<style name="ActionBarPopupTheme">
<item name="android:textColor">#color/colorMenuText</item>
<item name="android:background">#color/colorMenuBackground</item>
</style>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<!-- MENU -->
<item name="android:actionBarStyle">#style/ActionBarTheme</item>
<item name="actionBarStyle">#style/ActionBarTheme</item>
<!-- DIALOG -->
<item name="md_color_title">#color/colorPrimary</item>
<item name="md_color_content">#color/colorPrimaryDark</item>
<item name="md_color_button_text">#color/colorAccent</item>
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorTest2</item>
<item name="colorPrimaryDark">#color/colorTest3</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:actionMenuTextColor">#color/colorMenuText</item>
<item name="android:textColor">#color/colorWhite</item>
<item name="color">#color/colorTest4</item>
<item name="colorSecondary">#FF0000</item>
<item name="android:colorBackground">#color/colorBackground</item>
<item name="colorError">#color/colorError</item>
<item name="colorPrimaryVariant">#color/colorAccent</item>
<item name="colorSecondaryVariant">#color/colorTest</item>
<item name="colorSurface">#313131</item>
<item name="colorOnPrimary">#00BCD4</item>
<item name="colorOnSecondary">#00BCD4</item>
<item name="colorOnBackground">#673AB7</item>
<item name="colorOnError">#2196F3</item>
<item name="colorOnSurface">#color/colorOnAccent</item> <!-- placeholder farbe -->
<item name="scrimBackground">#E607FF</item>
<item name="android:editTextColor">#color/colorText</item>
<item name="android:textColorPrimary">#color/colorText</item>
<item name="android:textColorSecondary">#color/colorText</item>
<item name="android:textColorTertiary">#color/colorText</item>
<item name="android:textColorPrimaryInverse">#color/colorText</item>
<item name="android:textColorSecondaryInverse">#color/colorText</item>
<item name="android:textColorTertiaryInverse">#color/colorText</item>
</style>
<style name="MyTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyTheme.ActionBarStyle</item>
</style>
<style name="MyTheme.ActionBarStyle" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:titleTextStyle">#style/MyTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="MyTheme.ActionBar.TitleTextStyle" parent="#android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#color/colorMenuText</item>
</style>
<style name="Theme.MyApp" parent="Theme.AppCompat">
<!-- DIALOG -->
<item name="md_color_title">#color/colorPrimary</item>
<item name="md_color_content">#color/colorPrimaryDark</item>
<item name="md_color_button_text">#color/colorAccent</item>
<!-- Original AppCompat attributes. -->
<item name="colorPrimary">#color/colorTest4</item>
<item name="colorSecondary">#color/colorTest5</item>
<item name="android:colorBackground">#color/colorBackground</item>
<item name="colorError">#color/colorError</item>
<!-- New MaterialComponents attributes. -->
<item name="colorPrimaryVariant">#color/colorAccent</item>
<item name="colorSecondaryVariant">#color/colorTest</item>
<item name="colorSurface">#313131</item>
<item name="colorOnPrimary">#9C27B0</item>
<item name="colorOnSecondary">#00BCD4</item>
<item name="colorOnBackground">#673AB7</item>
<item name="colorOnError">#2196F3</item>
<item name="colorOnSurface">#E91E63</item>
<item name="scrimBackground">#FFC107</item>
<item name="textAppearanceHeadline1">#style/TextAppearance.MaterialComponents.Headline1</item>
<item name="textAppearanceHeadline2">#style/TextAppearance.MaterialComponents.Headline2</item>
<item name="textAppearanceHeadline3">#style/TextAppearance.MaterialComponents.Headline3</item>
<item name="textAppearanceHeadline4">#style/TextAppearance.MaterialComponents.Headline4</item>
<item name="textAppearanceHeadline5">#style/TextAppearance.MaterialComponents.Headline5</item>
<item name="textAppearanceHeadline6">#style/TextAppearance.MaterialComponents.Headline6</item>
<item name="textAppearanceSubtitle1">#style/TextAppearance.MaterialComponents.Subtitle1</item>
<item name="textAppearanceSubtitle2">#style/TextAppearance.MaterialComponents.Subtitle2</item>
<item name="textAppearanceBody1">#style/TextAppearance.MaterialComponents.Body1</item>
<item name="textAppearanceBody2">#style/TextAppearance.MaterialComponents.Body2</item>
<item name="textAppearanceCaption">#style/TextAppearance.MaterialComponents.Caption</item>
<item name="textAppearanceButton">#style/TextAppearance.MaterialComponents.Button</item>
<item name="textAppearanceOverline">#style/TextAppearance.MaterialComponents.Overline</item>
</style>
</resources>
I tried this minimum sample of your code and it gives me the desired behavior
I think there is a conflict with your styles
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="actionBarTheme">#style/ActionBarTheme</item>
</style>
<style name="ActionBarTheme" parent="#style/ThemeOverlay.MaterialComponents.ActionBar">
<item name="android:textColorPrimary">#ffffff</item>//for title text color
<item name="colorPrimary">#D81B60</item>// for toolbar background
<item name="popupTheme">#style/ActionBarPopupTheme</item>
</style>
<style name="ActionBarPopupTheme">
<item name="android:textColor">#304FFE</item> // for option menu text color
</style>

Transparent Overlay ActionBar with AppCompat?

I would like to have an ActionBar with the following properties:
Overlay bar, so that the layout's parent view will stretch to full the whole window.
A white title color for the ActionBar.
Transparent background.
I'm targeting API 14+, with AppCompat-v7:22.2.1. So I prepare my styles like this:
<style name="Theme.MyTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/Theme.MyTheme.MyActionBar</item>
<item name="actionBarStyle">#style/Theme.MyTheme.MyActionBar</item>
<item name="colorPrimary">#5af142</item>
<item name="colorPrimaryDark">#06dd09</item>
<item name="colorAccent">#20f304</item>
</style>
<style name="Theme.MyTheme.MyActionBar" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:background">#android:color/transparent</item>
<item name="background">#android:color/transparent</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
<item name="android:textColor">#android:color/white</item>
</style>
And, in the Manifest, I set Theme.MyTheme as my activity's theme.
1 & 2 are working, 3 is not. It seams that I get a grey-ish background, and I don't know what should I change/add.
Try out below code, which is my styles.xml
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!--<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>-->
<item name="android:windowActionBarOverlay">true</item>
<item name="android:actionBarStyle">#style/MyActionBar</item>
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
<item name="actionBarStyle">#style/MyActionBar</item>
<item name="android:windowContentOverlay">#null</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar"
parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background">#color/transparent</item>
<item name="android:titleTextStyle">#style/Theme.YourTheme.Styled.ActionBar.TitleTextStyle</item>
<!-- Support library compatibility -->
<item name="background">#color/transparent</item>
<item name="titleTextStyle">#style/Theme.YourTheme.Styled.ActionBar.TitleTextStyle</item>
</style>
<style name="Theme.YourTheme.Styled.ActionBar.TitleTextStyle" parent="#android:style/Widget.TextView">
<item name="android:textSize">13sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">#android:color/white</item>
<item name="textSize">13sp</item>
<item name="textStyle">bold</item>
<item name="textColor">#android:color/white</item>
</style>
</resources>

AppCompat Title color

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 :(

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.

ActionBarSherlock spinner item background ignored

I have a share action item, and no matter what I do the spinner does not seem to respect the styles I set. I used the style generator here http://jgilfelt.github.com/android-actionbarstylegenerator/
Here is a snippet of my themes file
<style name="Theme.Next" parent="#style/Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarItemBackground">#drawable/selectable_background_next</item>
<item name="popupMenuStyle">#style/next_PopupMenu</item>
<item name="dropDownListViewStyle">#style/next_DropDownListView</item>
<item name="actionBarTabStyle">#style/next_ActionBarTabStyle</item>
<item name="actionDropDownStyle">#style/next_DropDownNav</item>
<item name="actionBarStyle">#style/next_solid_ActionBar</item>
<item name="android:actionBarItemBackground">#drawable/selectable_background_next</item>
<item name="android:popupMenuStyle">#style/next_PopupMenu</item>
<item name="android:dropDownListViewStyle">#style/next_DropDownListView</item>
<item name="android:actionBarTabStyle">#style/next_ActionBarTabStyle</item>
<item name="android:actionDropDownStyle">#style/next_DropDownNav</item>
<!-- Light.DarkActionBar specific -->
<item name="actionBarWidgetTheme">#style/Theme.next.widget</item>
<item name="android:actionBarWidgetTheme">#style/Theme.next.widget</item>
</style>
<style name="next_DropDownNav" parent="#style/Widget.Sherlock.Spinner.DropDown.ActionBar">
<item name="background">#drawable/spinner_background_ab_next</item>
<item name="android:background">#drawable/spinner_background_ab_next</item>
<item name="android:popupBackground">#drawable/menu_dropdown_panel_next</item>
<item name="android:dropDownSelector">#drawable/selectable_background_next</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.next.widget" parent="#style/Theme.Sherlock">
<item name="popupMenuStyle">#style/next_PopupMenu</item>
<item name="dropDownListViewStyle">#style/next_DropDownListView</item>
<item name="android:popupMenuStyle">#style/next_PopupMenu</item>
<item name="android:dropDownListViewStyle">#style/next_DropDownListView</item>
</style>
spinner_background_ab_next points to a selector with my proper custom drawables. No matter what I change, the share spinner always uses the default ICS blue. Anyone run into this problem?

Categories

Resources