This can be achieved with the help of themes.
In your values res folder create some file, for instance, size.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="my_text_size" type="dimen">12sp</item>
</resources>
Then, in your values/styles.xml create new theme:
<style name="MyTextView" parent="@style/Widget.AppCompat.TextView">
<item name="android:textSize">@dimen/my_text_size</item>
</style>
Then, apply your new style to your TextView widgets:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MyTextView"
android:text="HELLO1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/MyTextView"
android:text="HELLO2"/>
</LinearLayout>