Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The layout for flexible text length.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical">
<TextView
android:id="@+id/itemPrefix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="'"/>
<!-- Flexible text -->
<TextView
android:id="@+id/itemText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:layout_weight="1"/>
<TextView
android:id="@+id/itemSuffix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="'"/>
</LinearLayout>
@r21nomi

This comment has been minimized.

Copy link
Owner Author

r21nomi commented Apr 4, 2016

not

|'This is a long long long...|

but

|'This is a long long long...'|

suffix ' is included event if the body text is ellipsized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.