It's very strange that why fontFamily is not working on androidX .
this is my code:
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="testing "
android:textSize="17sp"
android:fontFamily="@font/iransans"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
the above code doesn't effect font at all , when I convert the textview to app compact, then it works :
<androidx.appcompat.widget.AppCompatTextView
i wanted to set my whole application font but it doesn't work as I expected :
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:fontFamily">@font/iransans</item>
</style>
is there any way to solve this ? How can I use my font in entire app without setting font family for each view ?