title: Full Width Dialog on Bottom of Screen - Android
body: <p><a href="https://i.stack.imgur.com/jrgOL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jrgOL.png" alt="enter image description here"></a></p>
  
  <p>I have to create the similar UX on some event. This is the UX of Any.Do android app.</p>
  
  <p>I tried to achieve this by specifying my activity theme as <code>Theme.AppCompat.Light.Dialog</code> and setting Window Layout Params gravity to Bottom.</p>
  
  <p>But I am getting this :</p>
  
  <p><a href="https://i.stack.imgur.com/nPWAd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nPWAd.png" alt="enter image description here"></a></p>
  
  <p>The Dialog is not drawing of full width. I tried to alter following properties of <code>Theme.AppCompat.Light.Dialog</code> :</p>
  
  <pre><code>&lt;item name="android:windowMinWidthMajor"&gt;100%&lt;/item&gt;
  &lt;item name="android:windowMinWidthMinor"&gt;100%&lt;/item&gt;
  </code></pre>
  
  <p>Then I get this :</p>
  
  <p><a href="https://i.stack.imgur.com/aZ4yA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aZ4yA.png" alt="enter image description here"></a></p>
  
  <p>When I increase any of Minor or Major width properties, The Dialog appears as following:</p>
  
  <p><a href="https://i.stack.imgur.com/THCBl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/THCBl.png" alt="enter image description here"></a></p>
  
  <p>My Manifest:</p>
  
  <pre><code>&lt;activity android:name=".ScreenRateReminder"
            android:theme="@style/CustomDialog"/&gt;
  </code></pre>
  
  <p>Style Definition:</p>
  
  <pre><code>&lt;style name="CustomDialog" parent="Theme.AppCompat.Light.Dialog"&gt;
          &lt;item name="android:windowMinWidthMajor"&gt;100%&lt;/item&gt;
          &lt;item name="android:windowMinWidthMinor"&gt;100%&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>Layout Code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"&gt;
  
          &lt;RelativeLayout
              android:id="@+id/company_info_layout"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:paddingTop="10dp"
              android:paddingBottom="10dp"
              android:paddingLeft="20dp"
              android:paddingRight="20dp"&gt;
  
              &lt;de.hdodenhof.circleimageview.CircleImageView
                  android:id="@+id/logo"
                  android:layout_width="100dp"
                  android:layout_height="100dp"
                  android:src="@drawable/building_image"/&gt;
  
              &lt;LinearLayout
  
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="vertical"
                  android:layout_toRightOf="@+id/logo"
                  android:layout_marginTop="20dp"
                  android:paddingLeft="10dp"
                  android:paddingRight="10dp"
                  android:layout_centerVertical="true"&gt;
  
                  &lt;TextView
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:text="Title"/&gt;
  
                  &lt;TextView
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:text="Tagline"/&gt;
              &lt;/LinearLayout&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="30dp"
              android:gravity="center"
              android:orientation="horizontal"&gt;
  
  
                  &lt;ImageView
                      android:id="@+id/btn_satisfied"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:src="@drawable/ic_smile" /&gt;
  
                  &lt;ImageView
                      android:id="@+id/btn_happy"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:src="@drawable/ic_average"
                      android:layout_marginLeft="20dp"/&gt;
  
                  &lt;ImageView
                      android:id="@+id/angry_button"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:src="@drawable/ic_angry"
                      android:layout_marginLeft="20dp"/&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Activity Code:</p>
  
  <pre><code>public class RateReminderActivity extends Activity{
  
      @Override
      protected void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          Window window = getWindow();
          WindowManager.LayoutParams layoutParams =  window.getAttributes();
          layoutParams .gravity = Gravity.BOTTOM;
  
          window.setAttributes(layoutParams);
  
          requestWindowFeature(Window.FEATURE_NO_TITLE);
  
          setContentView(R.layout.screen_rate_reminder);
  
  }
  </code></pre>
  
  <p>I even tried by : window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);</p>
  
  <p>and :</p>
  
  <pre><code>wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
  wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
  </code></pre>
  
  <p>But for me nothing is making the dialog as full width.</p>