Autoresize textView and layout
<p>I have a custom dialog where I show a some result. The result text can have different size and when its small in dialog are many free space. How can I do autoresize textView for result and autoresize layout?</p>

<pre><code>&lt;LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="300dp"
        android:background="@drawable/dialog_bg"
        android:orientation="vertical" &gt;

        &lt;TextView
            android:id="@+id/textView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.01"
            android:gravity="center"
            android:text="Scores"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="18sp"
            android:textStyle="italic"
            android:typeface="serif" /&gt;

        &lt;EditText
            android:id="@+id/editText1"
            android:layout_width="fill_parent"
            android:layout_height="80dp"
            android:layout_marginBottom="20dp"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"
            android:layout_marginTop="10dp"
            android:layout_weight="0.04"
            android:background="@null"
            android:cursorVisible="false"
            android:editable="false"
            android:ems="10"
            android:focusable="false"
            android:focusableInTouchMode="false"
            android:gravity="top|left"
            android:inputType="textMultiLine|textNoSuggestions|textFilter"
            android:textColor="@android:color/white"
            android:textSize="16sp"
            android:textStyle="italic"
            android:typeface="serif" &gt;

            &lt;requestFocus /&gt;
        &lt;/EditText&gt;

        &lt;LinearLayout
            android:layout_width="match_parent"
            android:layout_height="42dp"
            android:layout_margin="10dp" &gt;

            &lt;Button
                android:id="@+id/ok"
                android:layout_width="70dp"
                android:layout_height="wrap_content"
                android:background="@drawable/ok"
                android:onClick="okAction" /&gt;

            &lt;LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="0.99" &gt;
            &lt;/LinearLayout&gt;

            &lt;Button
                android:id="@+id/share"
                android:layout_width="91dp"
                android:layout_height="wrap_content"
                android:background="@drawable/share"
                android:onClick="shareAction" /&gt;
        &lt;/LinearLayout&gt;
    &lt;/LinearLayout&gt;
</code></pre>
