title: Removing the extra top space in CoordinatorLayout- Android
body: <p>I am trying to use <code>BottomSheetBehavior</code> to make a layout similar to what google maps is providing. I am successful in using the <code>BottomSheetBehavior</code> and create slide up layout. The problem I am having now is <code>CordinatorLayout</code> takes extra space even when my layout is collapsed. 
  Below is a screenshot of my layout.</p>
  
  <ul>
  <li>White background in my main activity layout</li>
  <li>Pink is my collapsed layout with peekHeight </li>
  <li>And the grey background is the one which should be transparent but takes the extra space.</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/efw8A.png" rel="noreferrer"><img src="https://i.stack.imgur.com/efw8A.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/MkkQw.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/MkkQw.jpg" alt="enter image description here"></a></p>
  
  <p>My main layout file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;FrameLayout
      android:layout_width="match_parent"
      android:layout_alignParentBottom="true"
      android:layout_height="wrap_content"&gt;
  
      &lt;include layout="@layout/sample_coordinator" /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>CordinatorLayout with BottomSheetBehavior</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:background="@color/common_google_signin_btn_text_light_disabled"&gt;
  
  &lt;FrameLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:behavior_hideable="false"
      app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="250dp"
          android:background="@color/colorPrimary" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p></p>