I have wrong button style on pre-Lollipop devices.
compiling using appcompat library.
compile 'com.android.support:appcompat-v7:23.0.1'
values/styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@android:color/holo_orange_light</item>
<item name="colorPrimaryDark">@android:color/holo_orange_dark</item>
<item name="colorAccent">@android:color/holo_green_light</item>
<item name="colorControlNormal">@android:color/holo_purple</item>
<item name="colorControlHighlight">@android:color/holo_red_light</item>
<item name="colorButtonNormal">@android:color/holo_green_light</item>
<item name="android:buttonStyle">@style/ButtonTheme</item>
</style>
<style name="ButtonTheme" parent="android:Widget.Button">
<item name="android:textColor">@android:color/white</item>
<item name="android:textAllCaps">true</item>
<item name="android:drawablePadding">10dp</item>
<item name="android:padding">10dp</item>
</style>
v21/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ButtonTheme" parent="android:Widget.Material.Button">
<item name="android:textColor">@android:color/white</item>
<item name="android:textAllCaps">true</item>
<item name="android:drawablePadding">10dp</item>
<item name="android:padding">10dp</item>
</style>
</resources>
The result is http://prntscr.com/8mt1jx
"New button" adding by xml on ISC has no style textColor and drawablePadding. Do you have any ideas to correct it?
The problem is the buttonStyle
in your normal styles.xml.
Replace
<item name="android:buttonStyle">@style/ButtonTheme</item>
With
<item name="buttonStyle">@style/ButtonTheme</item>
And it should work.
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