title: Planning a RelativeLayout with a hidden element
body: <p>I'm trying to convert my list items layout to use RelativeLayout (rather than nested LinearLayouts with weights). Pictured below are two images showing how I'd like the list items to look, with coloured borders around the 4 (/5) elements in each list item.</p>
  
  <p>Each list item also has a hidden view which expands when you press the arrow (purple border), to reveal another element underneath this all (yellow border in second image). I'm using SlideExpandableListView for this, which just requires the ids of the trigger and the hidden view to be set.</p>
  
  <p>The initial difficulty I'm facing is getting the orange and purple elements (<strong>O+P</strong>) to stay to the right of the green and blue (<strong>G+B</strong>), while letting <strong>G+B</strong> fill the remaining space in width-ways.</p>
  
  <p>The height of each element is 48dp, and the widths of <strong>O+P</strong> is also 48dp.</p>
  
  <p>In the layouts I've attempted so far, <strong>O+P</strong> will overlap <strong>G+B</strong>, or trying to use a right margin on <strong>G+B</strong>, <strong>O+P</strong> goes off screen.</p>
  
  <p>--</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!-- a single row item for a Stacks listview --&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;RelativeLayout
          android:id="@+id/primary_elements"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
          &lt;TextView
              android:id="@+id/listitem_name"
              android:layout_width="match_parent"
              android:layout_height="48dp"
              android:text="@string/lorem_title" /&gt;
  
          &lt;TextView
              android:id="@+id/listitem_notes"
              android:layout_width="match_parent"
              android:layout_height="48dp"
              android:layout_below="@id/listitem_name"
              android:text="@string/lorem_paragraph" /&gt;
  
      &lt;/RelativeLayout&gt;
  
      &lt;RelativeLayout
          android:id="@+id/secondary_elements"
          android:layout_width="48dp"
          android:layout_height="match_parent"
          android:layout_toRightOf="@id/listitem_name" &gt;
  
          &lt;TextView
              android:id="@+id/listitem_actionable_items"
              android:layout_width="match_parent"
              android:layout_height="48dp"
              android:layout_alignBottom="@+id/listitem_notes"
              android:layout_alignParentLeft="true"
              android:layout_marginBottom="16dp"
              android:background="@color/Khaki"
              android:gravity="center"
              android:textIsSelectable="false" /&gt;
  
          &lt;!-- Quick action button - specific ID is required (SlideExpandableListView lib) --&gt;
          &lt;RelativeLayout
              android:id="@+id/expandable_toggle_button"
              android:layout_width="match_parent"
              android:layout_height="48dp"
              android:layout_alignParentLeft="true"
              android:layout_alignParentRight="true" &gt;
  
              &lt;!-- ImageView (arrow) in here, works, taken out for brevity --&gt;
          &lt;/RelativeLayout&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;!-- Quick action expanded view - specific ID is required (SlideExpandableListView lib) --&gt;
      &lt;RelativeLayout
          android:id="@+id/expandable"
          android:layout_width="match_parent"
          android:layout_height="48dp"
          android:layout_below="@id/primary_elements"&gt;
  
          &lt;!-- TODO - options inside the hidden view--&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>--</p>
  
  <p><img src="https://i.stack.imgur.com/HpQdA.jpg" alt="ListItem elements with expanded view in hidden state">
  <img src="https://i.stack.imgur.com/KMUvJ.jpg" alt="ListItem elements with expanded view in visible state"></p>