3

Every android application/theme hast it's own basic theme color:

HTC Desire Z - green,

most Samsung deviced - yellow,...

It's the color of selected list items, option menu-radio button, radio button, progress-bars,....

I know how to change these colors individual. But is there a way to change all of them by setting one value?

Something like:

<style name="my_theme" parent="@android:style/Theme.Black">
      <item name="android:_DEFAULT_BASE_COLOR_1">#XXXXXX</item>
</style>

//EDIT:

So I'm looking for the keyword of _DEFAULT_BASE_COLOR_1, where I can set a color for radio button, slected list item with only one item. Is it possible?

Johannes Staehlin
  • 3,680
  • 7
  • 36
  • 50

2 Answers2

0

In your manifest in application tag define as :

    android:theme="@style/mytheme"

Now in res/values you can define a file say theme.xml with content as :

<resources> 
    <style name="mytheme" parent="@android:style/Theme" > 
       <item name="android:_DEFAULT_BASE_COLOR_1">#XXXXXX</item>
       <item name="android:windowNoTitle">true</item>
        ... . 
    </style>
</resources>
Rahul garg
  • 9,202
  • 5
  • 34
  • 67
  • that's what I already have :) I'm looking for the right keyword of '_DEFAULT_BASE_COLOR_1' – Johannes Staehlin Mar 13 '12 at 17:38
  • all of these generally have 9-patch images for it, rather than color definition. For e.g focussed Edit text you would see orange/blue in various devices..thats not color but all are drawables....You would have to modify each of them , like say for edit text `___mystyle___ ` – Rahul garg Mar 14 '12 at 04:40
  • taking your comment "You would have to modify each of them", meas there it's not possible to override the 'default' drawables for all once, because even in the 'standard theme' there are different drawables? – Johannes Staehlin Mar 14 '12 at 04:53
  • yup..there is nothing 'default' drawables in sdk... you can even actually see the drawables by looking in the android-sdk code of yours..in res/drwawable* directories of sdk... – Rahul garg Mar 14 '12 at 04:55
  • 7
    what is meant by android:_DEFAULT_BASE_COLOR_1 here? why this answer has been marked as accepted? – Sankar V Aug 26 '13 at 13:49
0

try this:

    <style name="my_theme" parent="@android:style/Theme.Black">
        <item name="listChoiceIndicatorSingle">xxxxxxx</item>
<item name="radioButtonStyle">xxxxxxx</item>
<item name="listChoiceBackgroundIndicator">xxxxxxx</item>
<item name="listViewStyle">xxxxxxx</item>
<item name="listDivider">xxxxxxx</item>
<item name="listSeparatorTextViewStyle">xxxxxxx</item>
    ....
    </style>
ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
  • well, that's what I'm trying to avoid (setting all styles manual). Besides that, a style doesn't take the listViewStyle and radioButtonStyle :) – Johannes Staehlin Mar 13 '12 at 18:30