title: Fragment not filling up entire screen/parent layout Android
body: <p>I have a FrameLayout in my app that is being replaced by a Fragment that contains a RecyclerView, but when it does that, the RecyclerView doesn't fill up the whole FrameLayout, there's a border around it.</p>
  
  <p><a href="https://i.stack.imgur.com/4VxUm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4VxUm.png" alt="Image"></a></p>
  
  <p>Parent Layout, this is what is called from MainActivity, it contains the FrameLayout that is going to be replaced:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:fab="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fitsSystemWindows="true"
  android:orientation="vertical"
  tools:context="com.jggdevelopment.wannacook.MainActivity"&gt;
  
  &lt;android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
      &lt;android.support.v7.widget.Toolbar 
  xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:background="@color/colorPrimary"
          android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"
          app:popupTheme="@style/AppTheme.PopupOverlay"/&gt;
  
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  
  &lt;FrameLayout
      android:id="@+id/relative_layout_for_fragment"
      tools:showIn="@layout/navigation_toolbar"
      tools:context="com.jggdevelopment.wannacook.MainActivity"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  &lt;/FrameLayout&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Fragment it's being replaced with, a RecyclerView:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  xmlns:fab="http://schemas.android.com/apk/res-auto"
  android:fitsSystemWindows="true"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/fridge_list"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:fitsSystemWindows="true"/&gt;
  
      &lt;com.getbase.floatingactionbutton.FloatingActionsMenu
          android:id="@+id/fab_menu"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@+id/floating_button"
          android:layout_alignParentEnd="true"
          android:layout_gravity="bottom|end"
          android:layout_marginEnd="16dp"
          android:layout_marginStart="16dp"
          fab:fab_labelStyle="@style/menu_labels_style"
          fab:fab_labelsPosition="left"
          fab:fab_icon="@drawable/ic_plus_white_24dp"
          fab:fab_addButtonColorNormal="@color/colorAccent"
          fab:fab_addButtonColorPressed="@color/colorAccentPressed"&gt;
  
          &lt;com.getbase.floatingactionbutton.FloatingActionButton
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:onClick="addNewItem"
              fab:fab_colorNormal="@color/white"
              fab:fab_colorPressed="@color/whitePressed"
              fab:fab_title="Add new item"
              fab:fab_icon="@drawable/ic_restaurant_black_24dp"
              /&gt;
  
      &lt;/com.getbase.floatingactionbutton.FloatingActionsMenu&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Code in MainActivity used to replace Fragment:</p>
  
  <pre><code>else if (id == R.id.nav_fridge) {
          FridgeFragment fridgeFragment = new FridgeFragment();
          FragmentManager manager = getSupportFragmentManager();
          manager.beginTransaction().replace(
                  R.id.relative_layout_for_fragment,
                  fridgeFragment,
                  fridgeFragment.getTag()
          ).commit();
      }
  </code></pre>