I have the following button:
You could try using a ColorStateList, it serves the purpose you are after, I think.
It is possible by having different images in drawable. Consider, if you want to change the green color into black, you need to have black color circle in drawable and then try this code. This will help you..
On the button click event, use this code
public void onClick(View v) {
if(v == ButtonName) {
ButtonName.setImageResource(R.drawable.ImageName);
}
}
Late reply, but I figured out that you can access each layer in a LayerList using FindDrawableByLayerId(). Then I have access to each object and set the appropriate color!