I have a table with multiple rows similar to this:
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="12sp"
android:layout_gravity="right|center_vertical"
android:layout_margin="4dip" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="some text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="13sp"
android:textStyle="bold"
android:layout_gravity="left|center_vertical"
android:layout_margin="4dip"
android:ellipsize="end"
android:lines="1"
android:scrollHorizontally="true"
android:layout_weight="1" />
<ImageView
android:src="@drawable/disclosure_indicator"
android:contentDescription="@string/emptyString"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="fitXY" />
</TableRow>
But the 2nd textview has it's last 'word' replaced with '...' if any row in the text view is wider than the remaining space.
So using something like:
"Some sort string"
"Some string that is a little bit longer"
"Singleword"
The table will render like so:
text | Some short... | >
text | Some string that is a little bit... | >
text | | >
When clearly there is enough space to display the whole string for the first row. How can I get it so truncation/elipsis works correctly for each row?