I have a Button, using like this <android.widget.Button
, because of needs to set up custom background (read more about issue with DayNight theme and Buttons). Next I need set custom font, see my style below. In Studio designer panel custom font looks good, but running on device there is Roboto (default) font instead of my custom font (Nunito). Any suggestions? AS4.1.2/API30
<style name="ButtonGetStarted" parent="Widget.MaterialComponents.Button">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">60dp</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">24sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/text_invert</item>
<item name="android:fontFamily">@font/app_font</item>
<item name="android:background">@drawable/button_selector_get_started</item>
</style>
app_font.xml:
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
<font
app:fontStyle="normal"
app:font="@font/nunito_regular" />
<font
app:fontStyle="italic"
app:font="@font/nunito_regular_italic" />
</font-family>