Java Android how can I make ImageView darker onClick

android, imageview, java

Solution

You May Put a `dark rectangle` behind your bitmap and set the `Bitmap's` `Opacity` instead of trying in `xml`.

Problem

As an iOS developer told me, iOS make an image darker when somebody tap it (I don't know how true it is) so I need the same thing. as I understand, I need a usual selector.xml to make a drawable with different states. What I need is to darken the image in a simple way, may be in xml-drawable somehow so I don't have to use Photoshop in which I have no skill. Is there a way to do so on xml-level?

Original source