title: Recyclerview not occupying whole width when used with weight
body: <p>I have a </p>
  
  <pre><code>       1. Framelayout(frame1) in which I am inflating a RecyclerView layout with weight 0.5 
  
         2. Framelayout(frame2) with visibility gone and weight 0.5 
  </code></pre>
  
  <p>My Recyclerview is occupying only half the width though frame2 is gone. If I use listview instead of RecyclerView, I dont have this issue. Can anyone suggest how to make Recyclerview occupy whole width ?</p>
  
  <p><strong>EDIT:</strong>
  If I scroll the recyclerview , it is taking up the whole width as expected. </p>
  
  <p>Adapter</p>
  
  <pre><code>    @Override
  public ListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_item, parent, false);
      ListViewHolder tvh = new ListViewHolder (v);
      return tvh;
  }
  </code></pre>
  
  <p>main_layout</p>
  
  <pre><code>        &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal"&gt;
  
          &lt;FrameLayout
              android:id="@+id/frame1"
              android:layout_width="0dp" // If I put match_parent here it works
              android:layout_height="match_parent"
              android:layout_weight="0.5"
              /&gt;
  
          &lt;FrameLayout
              android:id="@+id/frame2"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="0.5"
              android:visibility="gone" /&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>frame1_layout</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"&gt;
  
  &lt;android.support.v7.widget.RecyclerView
      android:id="@+id/recyclerView"
      android:layout_width="match_parent"
      android:layout_height="match_parent"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>recycler_item</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="70dp"
  android:layout_margin="5dp" &gt;
  
  
  
  &lt;ImageView
      android:id="@+id/imageIcon"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_centerVertical="true"
      android:scaleType="centerCrop"
      android:src="@drawable/ic_main" /&gt;
  
  &lt;TextView
      android:id="@+id/textName"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="12dp"
      android:layout_toRightOf="@+id/imageIcon"
      android:textSize="14sp" /&gt;
  
   &lt;TextView
      android:id="@+id/text2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_alignParentEnd="true"
      android:text="Test"
      android:layout_below="@+id/textName"
      android:textSize="12sp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>