I use this style to change the background color of my Button
:
<style name="AccentButton" parent="Widget.AppCompat.Button.Colored">
<item name="colorButtonNormal">@color/colorAccent</item>
<item name="android:textColor">@color/white</item>
</style>
And in layout:
<Button
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_login_login_button"
app:theme="@style/AccentButton"/>
It works. But when I call setEnabled(false)
on this Button
, it keeps the same color. How can I manage this case?