You can now do this without a third party library or a widget. It's built into TextView in API level 26. Add android:autoSizeTextType="uniform"
to your TextView
and set height to it. That's all. Use app:autoSizeTextType="uniform"
for backward compatibility
https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview.html
<?xml version="1.0" encoding="utf-8"?>
<TextView
android:layout_width="match_parent"
android:layout_height="200dp"
android:autoSizeTextType="uniform" />
You can also use TextViewCompat
for compatibility.