I have a LinearLayout "card" with an ImageView and a TextView. I want the card to be highlighted when the user taps it. See http://www.youtube.com/watch?v=Yx1l9Y7GIk8&feature=share&t=15m17s for an example.
This is easily done for the TextView by setting android:background="@drawable/blue_highlight"
. Below is res/drawable/blue_highlight.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@color/selected"/>
<item android:state_pressed="true" android:drawable="@color/pressed"/>
<item android:drawable="@color/bg_window"/>
</selector>
But this does not work for the ImageView because the image is in front and the background is not visible. How can I have the touch highlight effect with a semi-transparent color for an ImageView?