title: Dialog width and height issue
body: <p>i use custom dialog but in mobile device and in tab view but design is change when i check on tab </p>
  
  <p>i want same same dialog in all device.</p>
  
  <p>See my below code.</p>
  
  <pre><code>private void startDialog() {
  
      final Dialog dialog = new Dialog(activity);
      int width = (int)(getResources().getDisplayMetrics().widthPixels*0.70);
      int height = (int)(getResources().getDisplayMetrics().heightPixels*0.65);
      dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  
      dialog.setContentView(R.layout.checkout_alert_dialog);
      dialog.show();
      dialog.getWindow().setLayout(width, height);
  
  
      btn_cancle = dialog.findViewById(R.id.btn_cancle);
      btn_cancle.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Toast.makeText(activity, "Cancel coming soon", Toast.LENGTH_LONG).show();
              dialog.dismiss();
          }
      });
  
      btn_continue = dialog.findViewById(R.id.btn_continue);
      btn_continue.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Toast.makeText(activity, " Ok coming soon", Toast.LENGTH_LONG).show();
              dialog.dismiss();
          }
      });
  }
  </code></pre>
  
  <p>Below is <strong><code>Dialog.xml</code></strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:background="@color/white"
      &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"
          &gt;
  
          &lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              &gt;
  
              &lt;ImageView
                  android:id="@+id/iv_pointBox"
                  android:layout_width="@dimen/_80sdp"
                  android:layout_height="@dimen/_80sdp"
                  android:src="@drawable/ic_chekout_popup"
                  android:layout_centerHorizontal="true"
                  android:layout_marginTop="@dimen/_30sdp"
                  /&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:textSize="@dimen/normal_input_text_size"
                  android:text="You've chosen to redeem 865 Points and pay 44.44 AED. The Payment process might take Some times, please do not hit the back button or close the app. Would you like to continue. "
                  android:layout_centerHorizontal="true"
                  android:layout_marginLeft="@dimen/_20sdp"
                  android:layout_marginRight="@dimen/_20sdp"
                  android:layout_below="@+id/iv_pointBox"
                  android:layout_marginTop="@dimen/_15sdp"
                  /&gt;
           &lt;View
               android:layout_width="match_parent"
               android:layout_height="@dimen/_1sdp"
               android:background="@color/view_color"
               android:layout_above="@+id/linerbutton"
               /&gt;
           &lt;LinearLayout
               android:id="@+id/linerbutton"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:orientation="horizontal"
               android:layout_alignParentBottom="true"
               &gt;
              &lt;Button
                  android:id="@+id/btn_cancle"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:text="@string/lable_cancel"
                  android:textColor="@color/black"
                  android:textSize="@dimen/normal_input_text_size"
                  android:textStyle="bold"
                  android:background="@null"
                  android:gravity="center"
                  android:layout_weight="1"
                  /&gt;
  
               &lt;View
                   android:layout_width="@dimen/_1sdp"
                   android:layout_height="@dimen/_45sdp"
                   android:background="@color/view_color"
                   /&gt;
              &lt;Button
                  android:id="@+id/btn_continue"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:text="@string/lable_continue"
                  android:textColor="@color/black"
                  android:textSize="@dimen/normal_input_text_size"
                  android:textStyle="bold"
                  android:background="@null"
                  android:layout_weight="1"
                  android:gravity="center"
                  /&gt;
           &lt;/LinearLayout&gt;
          &lt;/RelativeLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I mention 2 screenshot of my device :</p>
  
  <p>Mobile Device Screen shot:</p>
  
  <p><a href="https://i.stack.imgur.com/00X6d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/00X6d.png" alt="enter image description here"></a></p>
  
  <p>Tab Screenshot :</p>
  
  <p><a href="https://i.stack.imgur.com/M6TZ5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M6TZ5.jpg" alt="enter image description here"></a></p>
  
  <p>See in screenshot dialog was change. <strong>So how to i fix it</strong></p>
  
  <p>Thanks in Advance : </p>