title: Android Relativelayout click background behaviour
body: <p>So i have a <code>RecyclerView</code> and it is populated by my custom layout (code below). I have made a background drawable and set it on the root of my custom layout so that when user clicks the item, the background colour changes. There is also an options button (3 dots) on every item's layout, which is also clickable and also needs to change the background colour when clicked.</p>
  
  <p>The problem is, when i set my drawable as background for the options menu the whole layout doesn't change colour when clicked (screens below)</p>
  
  <p>When i set the background on options menu as <code>"?android:attr/selectableItemBackground"</code>, everything works fine.</p>
  
  <p>Code for my layout:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:card_view="http://schemas.android.com/apk/res-auto"
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="60dp"
      android:background="@drawable/item_click"
      android:layout_marginBottom="2dp"&gt;
      &lt;ImageView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerVertical="true"
          android:paddingLeft="16dp"
          android:id="@+id/item_icon"
          android:src="@drawable/ic_folder" /&gt;
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:paddingLeft="72dp"
          android:layout_centerVertical="true"&gt;
          &lt;TextView
              android:id="@+id/item_name"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textColor="#333333"
              android:text="Caption"
              android:textSize="13sp" /&gt;
          &lt;TextView
              android:id="@+id/item_description"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textColor="#333333"
              android:text="Description"
              android:textSize="13sp" /&gt;
      &lt;/LinearLayout&gt;
      &lt;ImageView
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_alignParentRight="true"
          android:foregroundGravity="center_vertical"
          android:paddingLeft="16dp"
          android:paddingRight="16dp"
          android:id="@+id/item_menu"
          android:src="@drawable/ic_ellipsis_v"
          android:background="@drawable/item_click" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Code for the drawable:</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item
          android:state_focused="true"
          android:state_pressed="true"
          android:drawable="@color/primary_100" /&gt;
      &lt;item
          android:state_focused="false"
          android:state_pressed="true"
          android:drawable="@color/primary_100" /&gt;
      &lt;item
          android:drawable="@android:color/white" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>Item selected when the background of the options menu is set to <code>"?android:attr/selectableItemBackground"</code> (I want the whole row to change colour to blue):
  <a href="https://i.stack.imgur.com/19uhx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/19uhx.png" alt="Screenshot1"></a>  </p>
  
  <p>Item selected when the background of the options menu is set to my drawable:
  <a href="https://i.stack.imgur.com/6rgoH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6rgoH.png" alt="Screenshot2"></a></p>