activity_main.xmlarrays.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.codinginflow.autosizingtextviewexample.MainActivity">

    <TextView
        android:layout_width="50sp"
        android:layout_height="50sp"
        android:text="Hello World!"
        app:autoSizeMaxTextSize="100sp"
        app:autoSizeMinTextSize="20sp"
        app:autoSizePresetSizes="@array/autosize_text_sizes"
        app:autoSizeTextType="uniform"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:ignore="MissingPrefix" />

</android.support.constraint.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <array name="autosize_text_sizes">
        <item>10sp</item>
        <item>50sp</item>
        <item>150sp</item>
    </array>

</resources>