title: How to add persistent bottom sheet inside a fragment in Android
body: <p>I want to add persistent bottom sheet to my fragment. I have a basic fragment code and a bottom sheet layout. Can someone please help me integrating bottomsheet inside the fragment. </p>
  
  <p>Thanks for your time, appreciate it.</p>
  
  <p><strong>Here is my fragment:</strong> </p>
  
  <pre><code>package app.com.navact;
  
  import android.content.Context;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.design.widget.BottomSheetBehavior;
  import android.support.design.widget.TabLayout;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.LinearLayout;
  
  public class TabFragment1 extends Fragment {
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          return inflater.inflate(R.layout.fragment_tab_fragment1, container, false);
      }
  }
  </code></pre>
  
  <p><strong>Here is my persistent bottom sheet layout:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout
      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:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.mayojava.sample.bottomsheetdemo.MainActivity"&gt;
  
      &lt;!-- main content layout--&gt;
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:paddingBottom="@dimen/activity_vertical_margin"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"
          android:paddingTop="@dimen/activity_vertical_margin"&gt;
          ......
      &lt;/RelativeLayout&gt;
  
      &lt;!-- bottom sheet layout --&gt;
      &lt;RelativeLayout
          android:id="@+id/linear_layout_bottom_sheet"
          android:layout_width="match_parent"
          android:layout_height="220dp"
          app:behavior_peekHeight="80dp"
          app:behavior_hideable="true"
          app:layout_behavior="hellooooz"
          android:elevation="20sp"
          android:background="@color/colorAccent"&gt;
          &lt;TextView
              android:id="@+id/text_view_sheet_title"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="kalle kalle "
              android:textSize="16sp"
              android:padding="@dimen/activity_vertical_margin"/&gt;
  
          &lt;TextView
              android:id="@+id/text_view_more_content"
              android:text="helllo"
              android:textSize="18sp"
              android:textStyle="bold"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/text_view_sheet_title"
              android:paddingLeft="@dimen/activity_vertical_margin"
              android:paddingRight="@dimen/activity_vertical_margin"/&gt;
  
          &lt;Button
              android:text="balle balle"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_alignParentLeft="true"
              android:layout_marginLeft="@dimen/activity_vertical_margin"
              android:layout_marginRight="@dimen/activity_vertical_margin"
              android:layout_marginTop="@dimen/activity_vertical_margin" android:layout_below="@+id/text_view_more_content"/&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>