I found this when I was looking for a way to change the color of my imageviews when they're clicked so I can maintain a flat look to the design but still make it clear to the user that touching select imageviews will do something. The updated code in the first response is solid, but I changed the ACTION_UP code to .clearColorFilter() instead of setting a fully transparent filter because it felt cleaner to me. It's important to note (as I discovered here) that if you're using this on an element that has an OnClickListener then you should return false (because the event is absorbed by the click listener) but if all you want is a highlight when something is touched and no other listeners apply you should return true or the ACTION_UP code will never fire.









