title: LinearLayout: How to correctly wrap longer text with no line breaks
body: <p>this is currently my row layout for a listview:</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="match_parent"
      android:orientation="horizontal"&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="10dp"
          android:layout_marginLeft="5dp"
          android:text="99.99.9999"
          android:layout_weight="0.2"/&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:layout_weight="0.6"&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:padding="10dp"
              android:text="This is a correct looking text"
              android:id="@+id/txtComment"/&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="0.2"&gt;
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="right"
              android:layout_marginTop="10dp"
              android:textStyle="bold"
              android:layout_marginRight="5dp"
              android:text="-1234,56" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The problem is within the TextView with id <code>txtComment</code>. Everything is looking nicely for short text content and text content that contains regular line breaks.</p>
  
  <p>But as soon as there is a long text without line breaks, Android still wraps the text but also changes the weight of the surrounding LinearLayout so that the left and right textviews are being compressed.</p>
  
  <p>How can I make sure that for long texts without line breaks Android still respects the weights of the elements?</p>
  
  <p>Screenshots showing the issue:</p>
  
  <p><a href="https://i.stack.imgur.com/Pon3x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pon3x.png" alt="Short text"></a>
  <a href="https://i.stack.imgur.com/bfNwS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bfNwS.png" alt="Longer text with line breaks"></a>
  <a href="https://i.stack.imgur.com/9tWkf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9tWkf.png" alt="Longer text without line breaks"></a></p>