title: How to set the bottomsheet to the top of bottom navigationview
body: <p>I am trying to show the bottom sheet along with the BottomNavigationview.
  <a href="https://i.stack.imgur.com/pv398.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pv398.png" alt="But overlapping. Check Here"></a></p>
  
  <p>How I will give bottom margin to the Bottom sheet.</p>
  
  <p>XML code:</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:id="@+id/bottomSheet"
      android:background="@android:color/white"
      android:paddingTop="@dimen/activity_horizontal_margin"
      app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/bottomSheetRecyclerview"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
  &lt;/android.support.v4.widget.NestedScrollView&gt;
  </code></pre>
  
  <p>Implementation code:</p>
  
  <pre><code> override fun openBottomDialogView() {
  
          val bottomSheetView= findViewById&lt;NestedScrollView&gt;(R.id.bottomSheet) as NestedScrollView
          Log.e("Bottom sheet view ",bottomSheetView.toString())
  
  
           dashboardBottomSheetBehaviour = BottomSheetBehavior.from(bottomSheetView)
              dashboardBottomSheetBehaviour.isHideable=true
  
          if(dashboardBottomSheetBehaviour.getState() != BottomSheetBehavior.STATE_EXPANDED) {
  
              bottomSheetRecyclerview.layoutManager= LinearLayoutManager(this@DashboardActivity) as RecyclerView.LayoutManager?
              bottomSheetRecyclerview.adapter= BottomSheetDialogAdaptor(this@DashboardActivity, getBottomSheetitem())
              dashboardBottomSheetBehaviour.setState(BottomSheetBehavior.STATE_EXPANDED);
          }
          else {
              closeBottomView()
          }
      }
  </code></pre>
  
  <p>I tried to set the fixed height of nestedscrollview and then give margin but that also didn't work. </p>
  
  <p>About new issues I am facing </p>
  
  <pre><code>fun closedBottomView(){
       Log.e("CLose ","Old bottom sheet")
          dashboardBottomSheetBehaviour.state=BottomSheetBehavior.STATE_HIDDEN
          Log.e("Final state ",dashboardBottomSheetBehaviour.state.toString())
  
  }
  </code></pre>
  
  <p>Here final log says bottom sheet state is in STATE_SETTLING. But callback says it in HIDDEN state. </p>