title: BottomSheet fly away with visibility change
body: <p>I have a bottom sheet with a NestedScrollView inside (see below). When I press on a FAB button, I want to make some parts in this NestedScrollView invisible. But when I change some linearlayouts visibilities to GONE, bottomsheet fly aways from the top. See here:</p>
  
  <p><a href="https://i.stack.imgur.com/noYla.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/noYla.gif" alt="enter image description here"></a> </p>
  
  <p>You can get the whole code from <a href="https://github.com/Tanrikut/BottomSheetExample" rel="noreferrer">https://github.com/Tanrikut/BottomSheetExample</a></p>
  
  <p>My change visibility method:</p>
  
  <pre><code>private void changeVisibility() {
      subtitleLayout.setVisibility(View.GONE);
  
      coordinateLayout.setVisibility(View.GONE);
      timeLayout.setVisibility(View.GONE);
  
  }
  </code></pre>
  
  <p>My NestedScrollView xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:behavior_peekHeight="120dp"
      app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
      android:id="@+id/bottom_sheet_main"&gt;
  
      &lt;FrameLayout
          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_marginTop="28dp"
              android:background="@android:color/white"
              android:animateLayoutChanges="true"
              android:orientation="vertical"
              &gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="vertical"
                  android:paddingLeft="10dp"
                  android:paddingStart="10dp"
                  android:paddingTop="@dimen/activity_horizontal_margin"&gt;
  
                  &lt;TextView
                      style="@style/TextAppearance.AppCompat.Headline"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:text="Dandelion Chocolate"
                      android:id="@+id/title" /&gt;
                  &lt;LinearLayout
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginBottom="@dimen/activity_horizontal_margin"
                      android:layout_marginTop="16dp"
                      android:orientation="horizontal"
                      android:id="@+id/subtitleLayout"&gt;
  
                      &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:id="@+id/subtitle"
                          android:text="Subtitle" /&gt;
  
                  &lt;/LinearLayout&gt;
  
  
              &lt;/LinearLayout&gt;
  
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  android:padding="@dimen/activity_horizontal_margin"
                  android:id="@+id/coordinateLayout"&gt;
  
                  &lt;ImageButton
                      android:layout_width="24dp"
                      android:layout_height="24dp"
                      android:alpha="0.36"
                      android:src="@drawable/ic_room_24dp"
                      android:background="@null" /&gt;
  
                  &lt;TextView
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginLeft="@dimen/activity_horizontal_margin"
                      android:layout_marginStart="@dimen/activity_horizontal_margin"
                      android:text="740, Valencia St, San Francisco, CA"
                      android:textColor="@android:color/primary_text_light"
                      android:id="@+id/bottom_sheet_coordinate" /&gt;
  
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  android:padding="@dimen/activity_horizontal_margin"
                  android:id="@+id/timeLayout"&gt;
  
                  &lt;ImageButton
                      android:layout_width="24dp"
                      android:layout_height="24dp"
                      android:alpha="0.36"
                      android:src="@drawable/ic_query_builder_24dp"
                      android:background="@null" /&gt;
  
                  &lt;TextView
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_marginLeft="@dimen/activity_horizontal_margin"
                      android:layout_marginStart="@dimen/activity_horizontal_margin"
                      android:text="Wed, 10 AM - 9 PM"
                      android:textColor="@android:color/primary_text_light"
                      android:id="@+id/bottom_sheet_time" /&gt;
  
              &lt;/LinearLayout&gt;
  
  
          &lt;/LinearLayout&gt;
  
      &lt;/FrameLayout&gt;
  &lt;/android.support.v4.widget.NestedScrollView&gt;
  </code></pre>