0

for the last few days I'm trying to implement custom theme, which is created by Action Bar Style Generator to my application. I'm able to use theme with some generic samples from SDK, but I'm not able to use it with my application which uses ActionBarSherlock.

My application with ActionBarSherlock is a modified sample of Tabs and Pager. Steps which I do:

  1. Create theme with Android Action Bar Style Generator.
  2. Copy theme to res folder inside my application.
  3. Change theme in Manifest file.

After those steps only 'Action bar color' changes to correct one. All other styles are not used in application. I have tried many different approaches which I found online, but without success.

Thank you very much for your help.

Dni Nevi
  • 11
  • 4
  • http://stackoverflow.com/a/16213334/1567588 check this. if that is not what u are looking for, then let me know.. – SKK Aug 06 '13 at 19:24
  • Santhosh: I have tried now with holo generator. The tabs are changed to different style now (grey color) but the color is not orange like I set it. – Dni Nevi Aug 06 '13 at 19:42
  • I think for your requirement you must use both Action Bar sytle generator and also holo generator. Combine both into a single style after downloading them both. hope u understood. – SKK Aug 06 '13 at 19:50

2 Answers2

0

Did you add the proper items to your App's theme in styles.xml? You need to use attributes that are NOT prefixed with android:, for example:

<item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
<item name="background">@drawable/bg_striped</item>
<item name="backgroundSplit">@drawable/bg_striped_split</item>

You would also keep the properly prefixed ones for Android versions that have native actionbar.

<item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
<item name="android:background">@drawable/bg_striped</item>
<item name="android:backgroundSplit">@drawable/bg_striped_split</item>

The best place to understand this is to look at the demo provided with the ActionBarSherlock library project.

Karakuri
  • 38,365
  • 12
  • 84
  • 104
  • Karakuri: As I understand it, the attributes without android: prefix are used inside of theme style in values-14 folder and because of that they are not needed to be set in values folder. – Dni Nevi Aug 06 '13 at 19:55
  • No, the attributes without the prefix are used on earlier platform levels since Android did not use these attributes on earlier versions. – Karakuri Aug 06 '13 at 22:43
  • Karakuri: values-14 folder means for API level 14, which are devices with android > 4.0. Android Action Bar Style Generator generates folders for both pre 4.0 and post 4.0 version. I copied now items with android: prefix to the same location as those without, but still it does not help. Eventhough if I try application on pre 4.0 Android it does not work also. – Dni Nevi Aug 07 '13 at 07:18
0

I managed to fix the problem.

  1. I missed android:background attribute in TabWidget. This partially solves the problem.
  2. I had to set setLeftStripDrawable and setRightStripDrawable programatically.
Dni Nevi
  • 11
  • 4