title: FloatingActionButton visible for sometime even if visibility is set to gone
body: <p>I am having a FAB (FloatingActionButton) in my LinearLayout. I want the LinearLayout to be hidden i.e. visibility set to gone at first and on clicking menu button it should get visible. Everything is working fine but FAB remains visible for sometime before hiding itself. I tried everything from changing visibility of FAB and using hide() and show() but nothing works.</p>
  
  <p>I got the following links but for some reason they don't work for me.</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/31052324/floatingactionbutton-always-visible">FloatingActionButton always visible</a></li>
  <li><a href="https://stackoverflow.com/questions/32638346/gone-fab-becames-visible-for-a-while">Gone FAB becames visible for a while</a></li>
  <li><a href="https://stackoverflow.com/questions/31269958/floatingactionbutton-doesnt-hide">FloatingActionButton doesn't hide</a></li>
  </ol>
  
  <p>My activity_main.xml:</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:app="http://schemas.android.com/apk/res-auto" 
  android:id="@+id/drawer_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      tools:context="com.wolfarts.checklist2.MainActivity"&gt;
  
      &lt;android.support.v7.widget.Toolbar 
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:elevation="0dp"
          android:paddingTop="24dp"
          android:theme="@style/MyToolbarStyle"&gt;
  
              &lt;Spinner
                  android:id="@+id/spinner_nav"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content" 
                  style="@style/Base.TextAppearance.AppCompat.Title"
                  android:visibility="gone"/&gt;
  
      &lt;/android.support.v7.widget.Toolbar&gt;
  
      &lt;FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;LinearLayout
              android:id="@+id/emptyStateView"
              android:layout_width="match_parent"
              android:layout_height="match_parent"   
              android:orientation="vertical"
              android:gravity="center"&gt;
  
             &lt;ImageView
                  android:src="@drawable/emptystatebag"
                  android:layout_marginTop="-30dp"
                  android:layout_gravity = "center"
                  android:layout_height="170dp"
                  android:layout_width="300dp"/&gt;
  
             &lt;TextView
                  android:paddingTop="8dp"
                  android:layout_marginLeft="10dp"
                  android:layout_marginRight="10dp"
                  android:layout_height="wrap_content"
                  android:layout_width="wrap_content"
                  android:gravity = "center"
                  android:text="Nothing here. Try Adding Something."
                  android:textColor="#B8B8B8"
                  android:textSize="18sp"/&gt;
  
             &lt;/LinearLayout&gt;
  
          &lt;android.support.design.widget.CoordinatorLayout 
              android:id="@+id/maincontainer"  
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
                  &lt;LinearLayout
                      android:orientation="vertical"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:animateLayoutChanges="true"&gt;
  
                          &lt;LinearLayout
                              android:id="@+id/toolbarContent"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:orientation="vertical"
                              android:paddingLeft="72dp"
                              android:paddingStart="72dp"
                              android:paddingRight="18dp"
                              android:paddingEnd="18dp"
                              android:paddingBottom="80dp"
                              android:visibility="gone"
                              android:elevation="4dp"
                              android:descendantFocusability="beforeDescendants"
                              android:focusableInTouchMode="true"&gt;
  
                              &lt;android.support.design.widget.TextInputLayout
                                  android:id="@+id/username_text_input_layout"
                                  android:layout_width="match_parent"
                                  android:layout_height="wrap_content"
                                  android:textColorHint="#B3FFFFFF"
                                  android:layout_gravity="center_vertical"&gt;
  
                                  &lt;EditText
                                      android:id="@+id/taskName"
                                      android:layout_width="match_parent"
                                      android:layout_height="wrap_content"
                                      android:textSize="35sp"
                                      android:maxLines="1"
                                      android:hint="Item Name"/&gt;
  
                              &lt;/android.support.design.widget.TextInputLayout&gt;
  
                          &lt;/LinearLayout&gt;
  
                          &lt;com.wolfarts.checklist2.CustomRecyclerView
                              android:id="@+id/taskListRecyclerView"
                              android:layout_height="match_parent"
                              android:layout_width="match_parent"/&gt;
  
              &lt;/LinearLayout&gt;
  
              &lt;android.support.design.widget.FloatingActionButton
                  android:id="@+id/fab"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_margin="16dp"
                  android:paddingLeft="16dp"
                  android:clickable="true"
                  android:src="@drawable/ic_done_white_24dp"
                  app:layout_anchor="@id/toolbarContent"
                  app:layout_anchorGravity="bottom|right|end"
                  app:backgroundTint="@color/orange"
                  android:visibility="gone"
                  app:elevation="8dp"/&gt;
  
          &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
      &lt;/FrameLayout&gt;
  
  &lt;/LinearLayout&gt;
  
  
  
  &lt;LinearLayout
      android:id="@+id/navDrawer"
      android:layout_width="280dp"
      android:layout_height="match_parent"
      android:layout_gravity="left|start"&gt;
  
      &lt;ListView
          android:id="@+id/navList"
          android:paddingTop="24dp"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:divider="@android:color/transparent"
          android:dividerHeight="0dp"
          android:background="#ffeeeeee"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>Is this a bug in FAB?</p>