I want to accommodate for older Android versions (say 17 to 20) with specific style specs. So I made these:
In my values/styles.xml
file I keep the default for versions 21+. However, the style that's actually applied in both the preview and the virtual device is that of v20, for display versions 21 and up. If I erase values-v20/styles.xml
then it's the next one down the line, v19, that takes over. Why isn't the default style taking over?
Simple example:
values-v20/styles.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Button.AccentButton" parent="Theme.AppCompat">
<item name="android:textColor">@android:color/white</item>
<item name="android:background">@color/red</item>
</style>
</resources>
values/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Button.AccentButton" parent="Theme.AppCompat">
<item name="android:textColor">@android:color/white</item>
<item name="android:background">@color/green</item>
</style>
</resources>
Final result: v21+ button shows red, should be green.
It works the other way around!
In other words, the first versioned folder applies to all the following versions too. The un-versioned folder applies to versions below the lowest versioned folder.