I'm trying to create list item with blue overlay on top of the item. The blue overlay only appear when user touch on the item. So I'm placing view with background drawable to cover the whole item.
The problem now is that this View
never get drawn at all. I could switch the background to simple color and it would not appear. If I change it to TextView instead, the text will be shown but not covered the whole item. What am I doing wrong?
The layout get updated for sure, if I change color of any TextView
it would apply that change accordingly.
Here's a layout for the list item.
<?xml version="1.0" encoding="utf-8"?>
..<!-- other stuff -->..
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:background="@drawable/item_overlay"
android:duplicateParentState="true"
android:visibility="visible"
/>