I was able to achieve desired results on Kitkat and Lollipop by using the following setup:
build.gradle (partial)
dependencies {
compile 'com.android.support:appcompat-v7:22.1.1'
}
values/styles.xml
<resources>
<style name="Theme.AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
</style>
<style name="ThemeOverlay.AppTheme.Blue" parent="ThemeOverlay.AppCompat.Dark">
<!-- ThemeOverlay themes define only some attributes, those which make
backgrounds dark and highlights and texts light for ThemeOverlay.AppCompat.Dark
or the other way around for .Light. The rest is taken from the activity theme.
You only customize what you need - here the button color. -->
<item name="colorButtonNormal">@color/blue_500</item>
</style>
<style name="ThemeOverlay.AppTheme.Yellow" parent="ThemeOverlay.AppCompat.Light">
<!-- This worked correctly even with parent="Theme.AppTheme". -->
<item name="colorButtonNormal">@color/yellow_500</item>
</style>
</resources>
layout/activity_main.xml (partial)
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:theme="@style/ThemeOverlay.AppTheme.Blue"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:theme="@style/ThemeOverlay.AppTheme.Yellow"/>
EDIT: (oh yeah I forgot) MainActivity.java
public class MainActivity extends AppCompatActivity { ... }
Result
