title: Android persistent bottom sheet initial visibility
body: <p>I'm trying to implement a persistent bottom sheet in my layout - one that cannot be completely hidden, but always peeks from the bottom and can be expanded to full height. This is my layout:</p>
  
  <pre><code>&lt;android.support.design.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="match_parent"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"/&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:orientation="vertical"&gt;
  
          &lt;!-- main content --&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/layoutBottomSheet"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center|bottom"
          android:background="@drawable/custom_background"
          android:clipToPadding="false"
          android:gravity="center_horizontal"
          android:orientation="vertical"
          app:behavior_hideable="false"
          app:behavior_peekHeight="50dp"
          app:layout_behavior="@string/bottom_sheet_behavior"&gt;
  
          &lt;!-- bottom sheet content --&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>What I expect to happen is for the bottom sheet to be visible and collapsed as soon as I land on the screen, but it's not - it's hidden. I can get it to show up by calling <code>bottomSheetBehaviour.setState(BottomSheetBehavior.STATE_EXPANDED)</code> in <code>onCreate()</code>. This, curiously, only expands it slightly - more than the peek height specified but less than the full height it should take up. After it appears in this state I can drag it up and down to where it should be and it works fine. The problem is the initial landing on the screen is messed up. </p>
  
  <p>I'm sure there's a way I can get this working so the Bottom Sheet initially appears at it's peek height. Any ideas?</p>