title: Android BottomSheet expand to bottom of another view
body: <p>I'm trying to make this bottom sheet only expand to the bottom of another view but haven't been able to figure it out. I'd like the <code>locations_list_sheet</code> to expand to the bottom of <code>view1</code>.</p>
  
  <p>I've tried setting the offset, <code>bottomSheet.setExpandedOffset(48)</code> but no luck with that. I've also tried setting a margin to the top of the bottom sheet layout, but that didn't look right either.</p>
  
  <pre><code>&lt;layout xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"&gt;
  
      &lt;androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;View
              android:id="@+id/view1"
              android:layout_width="match_parent"
              android:layout_height="48dp"
              android:background="@android:color/transparent" /&gt;
  
          &lt;include
              android:id="@+id/map_content"
              layout="@layout/content_locations_stoneco" /&gt;
  
          &lt;include
              android:id="@+id/locations_list_content"
              layout="@layout/bottom_sheet_locations" /&gt;
  
      &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/vmBjr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vmBjr.png" alt="Layout"></a></p>