title: Android: how to make two TextViews placed in different lines if there is not enough space in one line
body: <p>I'm trying to organize two TextViews to behave like that:</p>
  <p><img src="https://i.stack.imgur.com/fgeer.png" alt="Example" /></p>
  <p>So, if there is enough space for both TextViews in line, android should place them in line.</p>
  <p>If there is not enough space, the second TextView must be placed on the next line with right alignment.</p>
  <pre><code>    &lt;LinearLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:orientation=&quot;horizontal&quot; &gt;
  
          &lt;TextView
              android:id=&quot;@+id/takeoffCity&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              style=&quot;@style/flightItem&quot; /&gt;
  
          &lt;TextView
              android:id=&quot;@+id/landingCity&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              style=&quot;@style/flightItem&quot; /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;style name=&quot;flightItem&quot; parent=&quot;@android:style/TextAppearance&quot;&gt;
      &lt;item name=&quot;android:textSize&quot;&gt;14dip&lt;/item&gt;
      &lt;item name=&quot;android:textColor&quot;&gt;@color/flightItemFont&lt;/item&gt;
      &lt;item name=&quot;android:scrollHorizontally&quot;&gt;true&lt;/item&gt;
      &lt;item name=&quot;android:textStyle&quot;&gt;bold&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>