SmurfXXX SmurfXXX - 2 months ago 14
Android Question

Theme.Material.Light override background button color

How can I override the default value of the background color for a button in a v21/v22 style.xml?

I made an application that is compatible from Honeycomb to Lollipop and I'd like to make a better style for Lollipop but I can't find how to override the default background color of buttons (for API before 21) to transparent (on API>21 I use

<item name="android:colorButtonNormal">color</item>
and
<item name="android:colorControlHighlight">color</item>
)

N J N J
Answer

You can create drawable like this in v21

    ?xml version="1.0" encoding="utf-8"?>
<!--drawable-v21/btn_fab_default.xml-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
    android:color="@color/fab_color_shadow">
    <item>
        <shape android:shape="oval">
            <solid android:color="@color/style_color_accent" />
        </shape>
    </item>
</ripple>

for more information visit this link