Skip to content

Instantly share code, notes, and snippets.

@tfcporciuncula
Created February 6, 2019 17:47
Show Gist options
  • Save tfcporciuncula/fe4d8c6b04ac77e85964face89835b1e to your computer and use it in GitHub Desktop.
Save tfcporciuncula/fe4d8c6b04ac77e85964face89835b1e to your computer and use it in GitHub Desktop.
Autosizing and ellipsize
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:background="@color/colorAccent"
android:ellipsize="end"
android:text="@string/long_sentence"
android:textColor="@android:color/white"
app:autoSizeMaxTextSize="60dp"
app:autoSizeMinTextSize="40dp"
app:autoSizeTextType="uniform" />
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment