Instead of having two ImageButtons you'd have a ToggleButton.
Instead of using onClick you'd use the onCheckChanged (I think that's the method) which gives you the View (ie ToggleButton) and the new value (on or off).
You can remove the isOn flag.
Inside the listener (now onChange) you'd not worry about the visible/invisible stuff (so throw that away) you'd just worry about the flash bit:
Note that that is not copy/paste code!
