title: Textview show partial text
body: <p>I have a TextView in which I must load a message. The TextView has maximum 2 lines (<code>android:lines="2"</code>). The message may contain an '\n' character.</p>
  
  <p>How should I load the message in that TextView so that words would be wrapped and if in those 2 lines message does not fit, at the end of last visible word I must add three dots (...)? How can I detect the length of text that fits in that TextView? </p>
  
  <p>My code for TextView is </p>
  
  <pre><code>&lt;TextView
              a:id="@+id/tv_message"
              a:gravity="top"
              a:layout_width="wrap_content"
              a:layout_height="wrap_content"
              a:layout_alignParentTop="true"
              a:layout_toRightOf="@id/iv_icon"
              a:layout_marginLeft="2dp"
              a:layout_marginTop="4dp"
              a:paddingRight="7dp"
              a:paddingBottom="5dp"
              a:textSize="12sp"
              a:typeface="sans"
              a:ellipsize="marquee"
              a:lines="2"
              a:maxLines="2"
              a:textColor="@android:color/black"
              /&gt;
  </code></pre>
  
  <p>But in application, text appears on two lines, even if there is a line containing the signature. The message is like: "message text" + "\nSignature" but the message can be on 1,2,3 lines, depending of message length.</p>