i am able to declare a theme and a specific button design:
<style name="MyTheme" parent="android:style/Theme.Black">
<item name="android:buttonStyle">@style/Button.b1</item>
</style>
<style name="Button.b1" parent="android:style/Widget.Button">
<item name="android:textColor">#000000</item>
</style>
The problem is that this style is applied to all buttons. I would like to declare a specific button with his own style changing each theme independent of the other buttons (something like a "save"-button). Any idea?
I tried the following:
<style name="Button.MyButton" parent="android:style/Widget.Button">
<item name="android:background">@drawable/shape</item>
</style>
<style name ="Button.MyButton.Theme1">
<item name="android:textColor">#000000</item>
</style>
<style name ="Button.MyButton.Theme2">
<item name="android:textColor">#FFFFFF</item>
</style>
<Button
android:id="@+id/save_button"
android:layout_width="0px"
style="@style/Button.MyButton"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/save"/>
Now the button is independent from the theme, but it should also apply the style attribute that I declared above. At the moment it only applies the attributes that are declared in the MyButton scope and not these in MyButton.Theme1 or MyButton.Theme2.