This is my AppTheme style in style.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:fontFamily" tools:targetApi="jelly_bean">@font/montserrat_regular</item>
<item name="fontFamily">@font/montserrat_regular</item>
</style>
and the application tag in manifest.xml
<application
android:name=".Amelio"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
What i want is to set fontFamily in AppTheme so i dont have to set it on every component in app. But i want to set custom font on some of TextView in app.
Issue is when i set fontFamily
in AppTheme
then i can not set font or fontFamily
on any TextView
. But i can set that when i remove fontFamily
and font
from AppTheme
. Here is the preview -
- with font attribute in AppTheme style
- without font attribute in AppTheme style
Note: I know either font or fontFamily can be used, i was just trying both if works. so please ignore it.