I have a TextView
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:ellipsize="middle"
android:maxLines="2"
/>
Notice maxLines="2"
. now i always want that the 2nd line will be a String that represents the date.
for example (very simplified, i'm actually using SpannableStringBuilder
):
String s = "this string is longer than 1 line"
s += "\n" + "Today, January, 2038"
Now i want to make sure that the date will be present alone at the second row and the TextView
rep will be something like:
"this string is longer than...
Today, January, 2038"
is it possible?