title: How to make BottomSheetDialog fullcreen when expanded and make button attached at bottom of it?
body: <h1><strong>Problem</strong></h1>
  <p>I need to use BottomSheetDialog <em>(com.google.android.material.bottomsheet)</em> for my apps, but it didn't work as i expected, Bottom Sheet Appear cut when it expanded.</p>
  <p><a href="https://i.stack.imgur.com/fZjTf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fZjTf.jpg" alt="enter image description here" /></a></p>
  <h2>My Implementation</h2>
  <pre class="lang-kotlin prettyprint-override"><code>inline fun &lt;T : ViewBinding&gt; Context.makeBottomSheetDialog(
          crossinline bindingInflater: (LayoutInflater) -&gt; T,
          isCancelable: Boolean = true,
          isHideable: Boolean = true,
          isFitContent: Boolean = true,
          peekHeight: Int? = null,
          onDismissListener: DialogInterface.OnDismissListener? = null,
  ): Pair&lt;T, BottomSheetDialog&gt; {
      val layout = bindingInflater.invoke(LayoutInflater.from(this@makeBottomSheetDialog))
      val dialog = BottomSheetDialog(this).apply {
          setContentView(layout.root)
          setOnDismissListener(onDismissListener)
          setCancelable(isCancelable)
      }.apply {
          behavior.apply {
              setHideable(isHideable)
              isFitToContents = isFitContent
              if(peekHeight != null) setPeekHeight(peekHeight)
          }
      }
      return Pair(layout, dialog)
  }
  </code></pre>
  <p>I've already researched this problem, and everyone suggests creating its own class, but in my case I want it to have a flexible view and easy to call with inline. When I saw the base code of BottomSheetDialog I thougth its because the container <em>(FrameLayout)</em> height not adjusted when BottomSheet is Expanded.</p>
  <h2>Question</h2>
  <p>how can I fix this problem? it makes me can't attach the button at the bottom of the view either.
  Thank you!</p>