In Android, whenever I click a button (namely an ImageButton), I want to give the user feedback by changing the color of the button (maybe inverting colors, or darkening, etc). At this point, I don't want to change to a new button or anything, just want to change state so as to reflect the click.
I realize I can add a new drawable, so each button would have 2 states (when clicked, I would change to the second state).
That is (pseudocode):
onClick {
ImageButton.setDrawable(R.drawable.myclickedbutton)}
Is there a better way to do this (I believe iOS will play with ImageColors for you when you click, and that's what I want here in Android), or is what I am thinking the only possibility?
I feel I'm missing something major with this concept.
Thanks in Advance.
Edit: If it makes a difference, my app runs on minimum target 2.2.
Edit 2: For clarification, I'm working with an Image Button which already has a custom drawable resource. That's what I want to manipulate onClick.
Edit 3: I don't think I'm being clear enough here. I know how to change the state using two drawables (whether it be onTouch, XML, onClick, etc.) I was asking if there was a way that Android (or some sort of method) can invert or darken colors for all buttons automatically when clicked (as iOS does, I believe). I am not asking how to do this on a button-to-button basis. This can be accomplished with 2 drawables per button, and I realize that.