I have a module with several product flavors ('foo' in this example). The base theme (style) is defined within the module.
Now my idea was to modify this theme in every flavor, by adding a styles.xml in #flavor#/res/values/ folder and extend the style, as I did it before in Eclipse, using library project mechanism. But obviously the complete style is overriden. My intention was, that gradle is merging the files together correctly.
main_styles:
<style name="Theme.Main" parent="android:Theme.Light">
<item name="android:title">A title</item>
<item name="android:subtitle">A subtitle</item>
</style>
foo_styles:
<style name="Theme.Main" parent="android:Theme.Light">
<item name="android:background">@color/foo</item>
</style>
What I expect:
<style name="Theme.Main" parent="android:Theme.Light">
<item name="android:title">A title</item>
<item name="android:subtitle">A subtitle</item>
<item name="android:background">@color/foo</item>
</style>
What I get:
<style name="Theme.Main" parent="android:Theme.Light">
<item name="android:background">@color/foo</item>
</style>
Any advice?
They'll only merge if they have the same name. Call them both styles.xml
.
EDIT: It appears that you can't: https://groups.google.com/forum/#!topic/adt-dev/sQTsk35U7Ic
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With