How to add android StateListAnimator to style.xml file?

I want to remove the shadow from the button, so I define the style for the button and add the stateListAnimator = @null tag to the style.xml file, but it does not work. But, when I add stateListAnimator = @null when defining a button in it, the layout file, its working fine.

This is the button style code -

<style name="ServiceButton" parent="Widget.AppCompat.Button.Colored">
    <item name="android:textColor">@android:color/white</item>
    <item name="android:colorButtonNormal">@color/light_blue</item>
    <item name="android:padding">@dimen/button_padding_medium</item>
    <item name="android:stateListAnimator">@null</item>
    <item name="android:textSize">@dimen/medium_text_size</item>
</style>
+4
source share

Source: https://habr.com/ru/post/1672574/


All Articles