I have an action bar configured using tab navigation. On the smaller screens, the tabs are below the action bar, and the larger screens are the tabs inside the action bar. My action bar is colored red and the tabs are black. When the tabs are below the action bar, I would like the selector to be colored red and then change the color to black if the tabs are inside the action bar.
My problem is that I either get a red selector both below and inside the action bar, or a black selector both below and inside the action bar. When the tabs are below the action bar, I would like the selector to be red, and when it is inside, I would like the selector to be black. Here is my styles_actionbar.xml:
<style name="Theme.customabthemegenerated" parent="@android:Theme.Holo.Light"> <item name="android:actionBarItemBackground">@drawable/selectable_background_customabthemegenerated</item> <item name="android:actionBarStyle">@style/solid_ActionBar</item> <item name="android:actionBarTabStyle">@style/ActionBarTabStyle</item> <item name="android:actionBarTabBarStyle">@style/ActionBarTabBarStyle</item> <item name="android:actionBarTabTextStyle">@style/ActionBarText</item> </style> <style name="solid_ActionBar" parent="@android:Widget.Holo.Light.ActionBar.Solid"> <item name="android:background">@drawable/ab_solid_customabthemegenerated</item> <item name="android:backgroundStacked">@drawable/ab_stacked_solid_customabthemegenerated</item> <item name="android:backgroundSplit">@drawable/ab_bottom_solid_customabthemegenerated</item> </style> <style name="ActionBarTabStyle" parent="@android:style/Widget.Holo.ActionBar.TabView"> <item name="android:background">@drawable/tab_indicator_inside</item> </style> <style name="ActionBarTabBarStyle" parent="@android:style/Widget.Holo.ActionBar.TabBar"> <item name="android:background">@drawable/tab_indicator_outside</item> </style> <style name="ActionBarText" parent="@android:style/TextAppearance"> <item name="android:textColor">@color/white</item> </style>
I thought ActionBarTabBarStyle would style the tabs when they are outside the action bar, but it seems to have no effect. Is there a way to get the red selector when the action bar is split, and the black selector when the action bar is folded?
user1780626
source share