I am trying to figure out how to change the color of icon which is in drawable left of button.
Below is the XML code I am using :
You can set tint programmatically like below:
int tintColor = ContextCompat.getColor(context, android.R.color.darker_gray);
Button button = (Button) findViewById(R.id.button);
Drawable drawable = ContextCompat.getDrawable(context, R.mipmap.ic_email_black_18dp);
drawable = DrawableCompat.wrap(drawable);
DrawableCompat.setTint(drawable.mutate(), tintColor);
drawable.setBounds( 0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
button.setCompoundDrawables(drawable, null, null, null);
Or you can use library Support Drawable Tints
by snodnipper.
This library enables to set tint for drawableLeft of Button.
https://github.com/snodnipper/android-appcompat-issue198613