Android Fill TextView (Auto Adjust TextSize)

July 5, 2019
app:autoSizeTextType="uniform”
<LinearLayout
    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/contentTextView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:autoSizeTextType="uniform"
        app:autoSizeMinTextSize="20sp"
        app:autoSizeMaxTextSize="36sp"
        app:autoSizeStepGranularity="4sp"
        android:gravity="center_vertical"
        />
</LinearLayout>

References:

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.