title: How to position dialog to the bottom
body: <p>I am trying to set the dialog to the bottom but couldn't able to do that. 
  It showing the top of the page. </p>
  
  <p>XML:</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:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="370dp"
      android:background="@android:color/transparent"
      xmlns:tools="http://schemas.android.com/tools"
      android:padding="8dp"
      android:orientation="vertical"&gt;
  
      &lt;android.support.v7.widget.CardView
          android:id="@+id/cv1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:cardCornerRadius="4dp"
          app:cardElevation="1dp"
          app:cardUseCompatPadding="true"&gt;
  
          &lt;ScrollView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"&gt;
  
  
              &lt;android.support.constraint.ConstraintLayout 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:layout_width="match_parent"
                  android:layout_height="wrap_content"&gt;
  
  
              &lt;TextView
                  android:id="@+id/textView14"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:background="@color/colorSecondaryBackground"
                  android:fontFamily="@font/gotham_medium_regular"
                  android:padding="8dp"
                  android:text="Send Promotions"
                  android:textColor="@color/colorSecondaryText"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toTopOf="parent" /&gt;
  
                  &lt;android.support.constraint.ConstraintLayout
                      android:id="@+id/promotionDataLayout"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:paddingBottom="@dimen/two_margin"
                      app:layout_constraintEnd_toEndOf="parent"
                      app:layout_constraintStart_toStartOf="parent"
                      app:layout_constraintTop_toBottomOf="@id/textView14"&gt;
  
                      &lt;android.support.v7.widget.RecyclerView
                          android:id="@+id/promotionList"
                          android:layout_width="0dp"
                          android:layout_height="wrap_content"
                          app:layout_constraintEnd_toEndOf="@id/guidelineEnd"
                          app:layout_constraintStart_toStartOf="@id/guidelineStart"
                          app:layout_constraintTop_toTopOf="parent"&gt;
  
                      &lt;/android.support.v7.widget.RecyclerView&gt;
  
                      &lt;android.support.constraint.Guideline
                          android:id="@+id/guidelineStart"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:orientation="vertical"
                          app:layout_constraintGuide_percent="0.08" /&gt;
  
                      &lt;android.support.constraint.Guideline
                          android:id="@+id/guidelineEnd"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:orientation="vertical"
                          app:layout_constraintGuide_percent="0.92" /&gt;
  
  
                  &lt;/android.support.constraint.ConstraintLayout&gt;          
                      &lt;/android.support.v7.widget.CardView&gt;
                  &lt;/android.support.constraint.ConstraintLayout
              &lt;/android.support.constraint.ConstraintLayout&gt;
          &lt;/ScrollView&gt;
  
  
      &lt;/android.support.v7.widget.CardView&gt;
  
      &lt;android.support.design.widget.FloatingActionButton
          android:id="@+id/fabDone"
          android:layout_width="64dp"
          android:layout_height="64dp"
          android:src="@drawable/red_plus"
          app:layout_anchor="@+id/cv1"
          app:elevation="1dp"
          app:backgroundTint="@android:color/white"
          app:layout_anchorGravity="center|bottom" /&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>I am creating the dialog class like that:</p>
  
  <pre><code>class PromotionDialog:Dialog{
  
     var mContext:Context?=null
      constructor(context: Context) : super(context) {}
  
      constructor(context: Context, themeResId: Int) : super(context, themeResId) {
          mContext=context
      }
  
     override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
  
          setContentView(R.layout.promotion_layout)// use your layout in place of this.
  
          window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT));
  
      }
  
     }
  </code></pre>
  
  <p>Solution Tried:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/a/9467151/1640009">https://stackoverflow.com/a/9467151/1640009</a></li>
  <li><a href="https://stackoverflow.com/a/9467151/1640009">https://stackoverflow.com/a/9467151/1640009</a></li>
  </ol>
  
  <p>I can't use bottomsheetdialog due to design constraint. </p>
  
  <p>EDIT: 
  I am calling the dialog like this</p>
  
  <pre><code>val promotionDialog= PromotionDialog(this@DashboardActivity, android.R.style.Theme_Material_Light_NoActionBar_Fullscreen)
      promotionDialog.show()
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <p>As @RAJA suggested, It was because of the FUll screen theme. </p>
  
  <p>So now I have change the theme to :</p>
  
  <pre><code> &lt;style name="ThemeDialog" parent="@style/Theme.AppCompat.Light.Dialog"&gt;
          &lt;item name="android:windowBackground"&gt;@null&lt;/item&gt;
          &lt;item name="android:background"&gt;@android:color/transparent&lt;/item&gt;
          &lt;item name="android:windowMinWidthMajor"&gt;100%&lt;/item&gt;
          &lt;item name="android:windowMinWidthMinor"&gt;100%&lt;/item&gt;
          &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;
  
      &lt;/style&gt;
  </code></pre>
  
  <p>But still there are some margin in the bottom</p>