I\'d like to change the color of a standard Android button slightly in order to better match a client\'s branding.
The best way I\'ve found to do this so far is to c
This is my solution which perfectly works starting from API 15. This solution keeps all default button click effects, like material RippleEffect. I have not tested it on lower APIs, but it should work.
All you need to do, is:
1) Create a style which changes only colorAccent:
I recommend using
ThemeOverlay.AppCompator your mainAppThemeas parent, to keep the rest of your styles.
2) Add these two lines to your button widget:
style="@style/Widget.AppCompat.Button.Colored"
android:theme="@style/Facebook.Button"
Sometimes your new
colorAccentisn't showing in Android Studio Preview, but when you launch your app on the phone, the color will be changed.