title: RecycleView layout manager list items are taking the whole screen
body: <p>So i just made this simple fragment that contains a RecycleView. The recycle view has a custom made relative layout with two TextViews and a CheckBox. The problem is that a single list item takes up the whole AVD seceen's space and the listener I set for the list item is not working.</p>
  
  <p><a href="http://i.stack.imgur.com/lspLX.png" rel="nofollow">here is a screenshot of the AVD screen (I am using android studio)</a></p>
  
  <p><a href="http://i.stack.imgur.com/vrvoL.png" rel="nofollow">And when scrolled</a></p>
  
  <p>The XML layout code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"&gt;
  &lt;CheckBox
      android:id="@+id/list_item_crime_solved_check_box"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:padding="4dp"
      /&gt;
      &lt;TextView
          android:id="@+id/list_item_crime_title_text_view"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_toLeftOf="@id/list_item_crime_solved_check_box"
          android:textStyle="bold"
          android:padding="4dp"
          tools:text="Crime Title"/&gt;
      &lt;TextView
          android:id="@+id/list_item_crime_date_text_view"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_toLeftOf="@id/list_item_crime_solved_check_box"
          android:layout_below="@id/list_item_crime_title_text_view"
          android:padding="4dp"
          tools:text="Crime date"
          /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The Fragment java code:</p>
  
  <pre><code>package com.bignerdranch.android.criminalintent;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.CheckBox;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import java.util.List;
  
  public class CrimeListFragment extends Fragment
  {
      private RecyclerView mCrimeRecyclerView;
      private CrimeAdabter mCrimeAdabter;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
      {
          View v = inflater.inflate(R.layout.fragment_crime_list, container, false);
          mCrimeRecyclerView = (RecyclerView) v.findViewById(R.id.crime_recycler_view);
          mCrimeRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
          updateUI();
          return v;
      }
  
      private void updateUI()
      {
          CrimeLab crimeLab = CrimeLab.get(getActivity());
          List&lt;Crime&gt; crimes = crimeLab.getCrimes();
          mCrimeAdabter = new CrimeAdabter(crimes);
          mCrimeRecyclerView.setAdapter(mCrimeAdabter);
      }
  
  
  }
  </code></pre>
  
  <p>The ViewHolder java code:</p>
  
  <pre><code>private class CrimeHolder extends RecyclerView.ViewHolder implements View.OnClickListener
  {
      private TextView mTitleTextView;
      private TextView mDateTextView;
      private CheckBox mCrimeSolvedCheckBox;
      private Crime mCrime;
  
      public CrimeHolder(View itemView)
      {
          super(itemView);
          mTitleTextView = (TextView) itemView.findViewById(R.id.list_item_crime_title_text_view);
          mDateTextView = (TextView) itemView.findViewById(R.id.list_item_crime_date_text_view);
          mCrimeSolvedCheckBox = (CheckBox) itemView.findViewById(R.id.list_item_crime_solved_check_box);
      }
  
      public void bindCrime(Crime crime)
      {
          mCrime = crime;
          mTitleTextView.setText(mCrime.getTitle());
          mDateTextView.setText(mCrime.getDate().toString());
          mCrimeSolvedCheckBox.setChecked(mCrime.isSolved());
      }
  
      @Override
      public void onClick(View v)
      {
          Intent i=new Intent(getActivity(),CrimeActivity.class);
          startActivity(i);
      }
  }
  </code></pre>
  
  <p>And the Adapter java code:</p>
  
  <pre><code>private class CrimeAdabter extends RecyclerView.Adapter&lt;CrimeHolder&gt;
  {
      private List&lt;Crime&gt; mCrimes;
  
      public CrimeAdabter(List&lt;Crime&gt; crimes)
      {
          mCrimes = crimes;
      }
  
      @Override
      public CrimeHolder onCreateViewHolder(ViewGroup parent, int viewType)
      {
          LayoutInflater inflater = LayoutInflater.from(getActivity());
          View v = inflater.inflate(R.layout.list_item_crime, parent, false);
  
          return new CrimeHolder(v);
      }
  
      @Override
      public void onBindViewHolder(CrimeHolder holder, int position)
      {
          Crime crime = mCrimes.get(position);
          holder.bindCrime(crime);
  
      }
  
  
      @Override
      public int getItemCount()
      {
          return mCrimes.size();
      }
  }
  </code></pre>