title: How can I implement BottomSheetDialogFragment with fixed height
body: <p>I need to implement <code>BottomSheetDialogFragment</code> and face with the problem.
  I need that my <code>BottomSheetDialogFragment</code> has fixed height. Does anyone has an idea how to do it?</p>
  
  <p>Here is my <strong>xml</strong> of fragment content</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="@dimen/bottom_sheet_height"
      android:background="@android:color/white"
      android:orientation="vertical"&gt;
  
      &lt;TextView
          android:id="@+id/drag_title"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textSize="24sp"
          android:textColor="#FF0000"
          android:text="Title"/&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/recycler_view"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:background="@android:color/white"
          android:layout_weight="1"/&gt;
  
      &lt;TextView
          android:id="@+id/ok_button"
          android:layout_width="match_parent"
          android:layout_height="54dp"
          android:background="@android:color/holo_blue_dark"
          android:gravity="center"
          android:text="Hello"
          android:textColor="@android:color/white"
          android:textSize="24sp"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And in the <code>setupDialog()</code> I am doing this:</p>
  
  <pre><code>@Override
  public void setupDialog(Dialog dialog, int style) {
      super.setupDialog(dialog, style);
      View contentView = View.inflate(getContext(), R.layout.bottom_sheet_dialog_content_view, null);
      dialog.setContentView(contentView);
      CoordinatorLayout.LayoutParams layoutParams = ((CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams());
      CoordinatorLayout.Behavior behavior = layoutParams.getBehavior();
      if (behavior != null &amp;&amp; behavior instanceof BottomSheetBehavior) {
          ((BottomSheetBehavior) behavior).setBottomSheetCallback(bottomSheetCallback);
          ((BottomSheetBehavior) behavior).setPeekHeight(getResources().getDimensionPixelSize(R.dimen.bottom_sheet_height));
      }
  
      initRecyclerView(contentView);
  }
  </code></pre>
  
  <p>And behavior is quite common:</p>
  
  <pre><code>private BottomSheetBehavior.BottomSheetCallback bottomSheetCallback = new BottomSheetBehavior.BottomSheetCallback() {
      @Override
      public void onStateChanged(@NonNull View bottomSheet, int newState) {
          if (newState == BottomSheetBehavior.STATE_HIDDEN) {
              dismiss();
          }
      }
  
      @Override
      public void onSlide(@NonNull View bottomSheet, float slideOffset) {
      }
  };
  </code></pre>
  
  <hr>
  
  <p><strong>UPD:</strong> Solved by set the fixed height to RecyclerView. Does anyone know the better approach?</p>