I want to set Roboto font across the app instead of using the device's system font.
In our project, we are still using android.app.DatePickerDialog. To change the font, I added a custom style on the instance of DatePickerDialog but only the font of the header is being changed.
Is it possible to change the font of the calendar view of DatePickerDialog?
DatePickerDialog
val c = Calendar.getInstance()
DatePickerDialog(
requireContext(),
R.style.DatePickerDialogTheme,
dateListener,
c.get(Calendar.YEAR),
c.get(Calendar.MONTH),
c.get(Calendar.DAY_OF_MONTH)
)
Custom Style
<style name="DatePickerDialogTheme" parent="ThemeOverlay.MaterialComponents.MaterialCalendar">
<item name="colorAccent">@color/colorAccent</item>
<item name="fontFamily">@font/roboto</item>
<item name="android:fontFamily">@font/roboto</item>
</style>