I have a button with background set to a drawable to get rounded corners on it. I am trying to get the button to change color on every click without having to make a drawable of every color I want to use.
Currently I am trying to use PorterDuff to apply a color filter over the drawable's white background.
Drawable mDrawable = ResourcesCompat.getDrawable(getResources(),
R.drawable.rounded_button, null);
mDrawable.setColorFilter(new PorterDuffColorFilter(0x800000ff,
PorterDuff.Mode.MULTIPLY));
When I load the app, the buttons remain white. Any idea on what I'm doing wrong or a better way to go about this?