title: Single textview list in recyclerview
body: <p>I want to make an app which shows list (RecyclerView). I want to include a single TextView in the Viewholder of this RecyclerView.</p>
  
  <p>MainActivity code:</p>
  
  <pre><code>    public class MainActivity extends AppCompatActivity implements View.OnClickListener{
  
      private CustomAdapter customAdapter;
      ListView listView;
      public Cursor cursor;
      public StudentRepo studentRepo;
      private final static String TAG = MainActivity.class.getName().toString();
  
      private static final String TAG_BOOKMARKS="bookmarks";
      private static final String TAG_ABOUT_US="about";
  
      //recyclerView implementation
      private List&lt;TopSample&gt; wordlist=new ArrayList&lt;&gt;();
      private RecyclerView recyclerView;
      private StudentAdapter studentAdapter;
      //recyclerView implementation done
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          studentRepo = new StudentRepo(this);
  
          //recyclerView implement
          recyclerView=(RecyclerView)findViewById(R.id.recycler_view);
          recyclerView.setHasFixedSize(true);
  
          DatabaseAccess databaseAccess = DatabaseAccess.getInstance(this);
          databaseAccess.open();
          Cursor cursor= databaseAccess.getInfo();
          cursor.moveToFirst();
          do{
              TopSample topSample=new TopSample(cursor.getString(0));
              wordlist.add(topSample);
          }while (cursor.moveToNext());
          databaseAccess.close();
  
          studentAdapter=new StudentAdapter(wordlist);
          RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
          recyclerView.setLayoutManager(mLayoutManager);
          //recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
          recyclerView.setItemAnimator(new DefaultItemAnimator());
          recyclerView.setAdapter(studentAdapter);
  </code></pre>
  
  <p>StudentAdapter class</p>
  
  <pre><code>public class StudentAdapter extends RecyclerView.Adapter&lt;StudentAdapter.MyViewHolder&gt; {
  
      private List&lt;TopSample&gt; wordslist= Collections.emptyList();
      public class MyViewHolder extends RecyclerView.ViewHolder{
          public TextView sword;
          public MyViewHolder(View view){
              super(view);
              sword=(TextView)view.findViewById(R.id.vocab);
          }
      }
  
      public StudentAdapter(List&lt;TopSample&gt; wordslist){
          this.wordslist=wordslist;
      }
  
      @Override
      public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View itemView=LayoutInflater.from(parent.getContext()).inflate(R.layout.dictionary_list_row,parent,false);
          MyViewHolder vh=new MyViewHolder(itemView);
          return vh;
  
          //return new MyViewHolder(itemView);
      }
  
      @Override
      public void onBindViewHolder(MyViewHolder holder, int position) {
          TopSample sample=wordslist.get(position);
          holder.sword.setText(sample.getVocab());
      }
  
      @Override
      public int getItemCount() {
          return wordslist.size();
      }
  }
  </code></pre>
  
  <p>TopSample code:</p>
  
  <pre><code>public class TopSample {
  
      public String vocab;
  
      public TopSample(){}
  
      public TopSample(String vocab){
          this.vocab=vocab;
      }
  
      public String getVocab() {
          return vocab;
      }
  
      public void setVocab(String vocab) {
          this.vocab = vocab;
      }
  }
  </code></pre>
  
  <p>content_main.xml</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"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      tools:showIn="@layout/activity_main"
      tools:context=".MainActivity"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/recycler_view"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:scrollbars="vertical" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>dictionary_list_row.xml</p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:focusable="true"
                  android:clickable="true"
                  android:background="?android:attr/selectableItemBackground"
                  android:orientation="vertical"&gt;
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="50dp"
          android:id="@+id/vocab"
          android:textSize="32dp"
          android:textStyle="bold"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>So the output was like:</p>
  
  <p><img src="https://i.stack.imgur.com/0sC8Rm.png" alt="Current Output"></p>
  
  <p>As you can see that an individual viewholder is taking longer rectangle size as expected and recycler view is not taking full match_parent command.</p>
  
  <p>I wish to have an output like this, just as an example.:<img src="https://i.stack.imgur.com/nWRcqm.png" alt="Expected Output just as an example"></p>
  
  <p>I tried to changed length and width with different combination in the two xml files but didn't get the result as expected. Kindly have a look and tell me where i am wrong.</p>
  
  <p>Just one more thing to add, i am extracting data from external database in which i am successful but this problem is probably layout problem, i think. Kindly correct me.</p>