title: Android: custom AlertDialog not wraps content correctly
body: <p>I have a problem with a custom <code>AlertDialog</code> layout params i'm not able to solve. So, please, helpe me.</p>
  
  <p>This is the AlertDialog layout (inputqty_dialog.xml):</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_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:padding="5dp" &gt;
  
     &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:layout_marginTop="7dp"
      android:layout_marginBottom="7dp"
      android:gravity="center_vertical" &gt;
  
      &lt;TextView
          style="@style/Label"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="wrap_content"
          android:textColor="#fff"
          android:gravity="left"
          android:text="AAAAAAAAA AAAAAAAAAA AA AAAAAAAA"/&gt;
  
      &lt;EditText
          style="@style/EditText"
          android:id="@+id/inputQtyDlg_qtyTxt"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="wrap_content"
          android:layout_marginLeft="5dp"
          android:inputType="numberDecimal"/&gt;
  
  
    &lt;/LinearLayout&gt;
  
  
    &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:layout_marginTop="7dp"
      android:layout_marginBottom="7dp"
      android:gravity="center_vertical" &gt;
  
  
      &lt;TextView
          style="@style/Label"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="wrap_content"
          android:textColor="#fff"
          android:gravity="left"
          android:text="@string/label_MAX_QTY"/&gt;
  
      &lt;EditText
          style="@style/EditText"
          android:id="@+id/inputQtyDlg_maxQtyTxt"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="wrap_content"
          android:layout_marginLeft="5dp"/&gt;
  
    &lt;/LinearLayout&gt;
  
  
    &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:layout_marginTop="7dp"
      android:layout_marginBottom="7dp"
      android:gravity="center_vertical" &gt;
  
      &lt;TextView
          style="@style/Label"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="wrap_content"
          android:textColor="#fff"
          android:gravity="left"
          android:text="AAAA AAAA A AAAAAAAAAA"/&gt;
  
      &lt;EditText
          style="@style/EditText"
          android:id="@+id/inputQtyDlg_requiredQtyTxt"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="wrap_content"
          android:layout_marginLeft="5dp"/&gt;
  
    &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is the code i use to inflate it:</p>
  
  <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  LayoutInflater inflater = getActivity().getLayoutInflater();
  View dialog_layout = inflater.inflate(R.layout.inputqty_dialog, null);
  builder .setTitle(getArguments().getString("message"))
                  .setView(dialog_layout));
  </code></pre>
  
  <p>And this is the orrible result i get:</p>
  
  <p><img src="https://i.stack.imgur.com/5scG3.jpg" alt="enter image description here"></p>
  
  <p>As you can see i have set <code>wrap_content</code> overall in layout file but <code>AlertDialog</code> overlooks that params and cuts the dialog not wrapping the content correctly. How can i solve? Thank you</p>