title: Android: Cut off to long multiline text in TextView
body: <p>I have a TextView with a height depending on previous content, but there might be a long Text in it. How can I cut it off at the right point and concatenate three dots or something similar to the new end?</p>
  
  <p>Currently it looks like this:
  <a href="https://i.stack.imgur.com/XMm1f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XMm1f.png" alt="Multiline text which is cut off"></a></p>
  
  <p>I found some solutions for Single Line Text, but how does it work with more than one line? I also do not know the number of lines, because this depends on the screen size.</p>
  
  <p>Are there other typical ways on Android to show that the text can be extended? E.g. a colour gradient in the last line?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>When I do it without a fixed heigth, I have to make the height depend on the element above and my XML will look like this:</p>
  
  <pre><code>&lt;TextView
     android:id="@+id/podcastShortDesc"
     android:text="Long text"
     android:layout_below="@+id/podcastTitle"
     android:layout_toRightOf="@+id/podcastLogo"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
  
     android:maxLines="3"
     android:ellipsize="end"
  
     android:layout_above="@+id/podcastMoreAction" /&gt;
  </code></pre>
  
  <p>When I do specify maxLines I can have luck an it will work:
  <a href="https://i.stack.imgur.com/kl5LJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kl5LJ.png" alt="I have luck"></a></p>
  
  <p>But if the title is too big, it does not work:</p>
  
  <p><a href="https://i.stack.imgur.com/e1qR0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e1qR0.png" alt="enter image description here"></a></p>