title: How to set the width of a DialogFragment in percentage?
body: <p>I have a <code>DialogFragment</code> with an xml layout and I need it to be, let's say 75% as wide as the screen. When I look for answers I always find the common <code>weight</code>-solution, which does not help me, as my fragment overlays the current activity as shown below and does not take the full screen's size. I also don't want to use "ems" as a fix width as I can't know the user's screen size.</p>
  
  <p><img src="https://i.stack.imgur.com/YT5VH.png" alt="enter image description here"></p>
  
  <p>Is there a way (preferably in xml) to set the root <code>LinearLayout</code>'s width to said 75%? I think it would be a possible workaround to define a whole set of <code>LinearLayout</code>s and make some of them transparent but this seems to be a rather ugly solution...</p>
  
  <p>If it helps, here is the fragment's layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android"
      android:layout_height   = "wrap_content"
      android:layout_width    = "match_parent"
      android:orientation     = "vertical" &gt;
  
      &lt;EditText
          android:hint            = "@string/inputhint_feedbackName"
          android:id              = "@+id/input_feedbackName"
          android:imeOptions      = "actionNext"
          android:inputType       = "textPersonName"
          android:layout_height   = "wrap_content"
          android:layout_width    = "match_parent"
          android:lines           = "1"
          android:maxLines        = "1"
          android:singleLine      = "true" &gt;
          &lt;requestFocus /&gt;
      &lt;/EditText&gt;
  
      &lt;EditText
          android:gravity             = "top"
          android:id                  = "@+id/input_feedbackMessage"
          android:imeOptions          = "actionDone"
          android:layout_height       = "wrap_content"
          android:layout_marginBottom = "20dp"
          android:layout_width        = "match_parent"
          android:lines               = "10"
          android:inputType           = "textMultiLine" /&gt;
  
      &lt;Button
          android:id                  = "@+id/button_feedbackSend"
          android:layout_height       = "wrap_content"
          android:layout_width        = "match_parent"
          android:text                = "@string/label_go"
          android:textSize            = "16sp"
          android:textStyle           = "bold" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>