title: Dialog layout container is too wide
body: <p>I have adapted a color picker dialog for my application.
  However, when it is displayed, it is far too wide.
  Either it will fill the entire width of the screen, or, if I put in a width value, it will still extend further.</p>
  
  <p>Here is my 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_width="400dp"
      android:layout_height="wrap_content"
      android:layout_gravity="center_vertical"
      android:orientation="vertical"
      android:paddingLeft="5dp"
      android:paddingRight="5dp" &gt;
  
      &lt;my.package.settings.ColourCtrl
          android:id="@+id/colour_control"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layerType="software"
          android:tag="portrait" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginLeft="6dp"
          android:layout_marginRight="6dp"
          android:layout_marginBottom="5dp" &gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:gravity="left"
              android:text="Tapper sur la couleur pour l'appliquer" /&gt;
  
          &lt;EditText
              android:id="@+id/etClrHexValue"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:hint="HEX"
              android:imeOptions="actionDone"
              android:maxLength="7"
              android:ems="7"
              android:singleLine="true"
              android:inputType="text|textNoSuggestions"
              android:visibility="visible" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="40dp"
          android:layout_marginBottom="10dp"
          android:orientation="horizontal" &gt;
  
          &lt;my.package.settings.ColourCtrl_PanelView
              android:id="@+id/clr_OldColour"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="0.5" /&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:layout_marginLeft="10dp"
              android:layout_marginRight="10dp"
              android:gravity="center"
              android:textSize="20sp"
              android:text="→" /&gt;
  
          &lt;my.package.settings.ColourCtrl_PanelView
              android:id="@+id/clr_NewColour"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="0.5" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is the UI dump of the resulting dialog :
  <img src="https://i.stack.imgur.com/4NJXO.jpg" alt="enter image description here"></p>
  
  <p>The highlighted row is where my layout comes in.</p>
  
  <p>There is no "tweaking" being done in the Dialog derived class.</p>
  
  <p>Is is possible to eliminate this extra space on the right ?</p>
  
  <p><strong>Edit :</strong> I am working on an Android 4.2.2 (api 19) tablet, with api 16 targeted, if this helps.</p>