Open jeffdgr8 opened 2 years ago
I can also reproduce the issue, and it is worse on 1.8.0 as the tabs reset to Roboto on click
@jeffdgr8 you can try set font manually to the tab layout. It helped me. https://briskandroid.medium.com/how-to-change-fonts-in-material-tab-layouts-tabs-ea777c7bd1af
Description: Similar to #965, except not while switching tabs, but resetting tabs with new data after view creation. Using a
StateFlow
in theFragment
'sViewModel
, which provides data for tabs, when theStateFlow
receives a new value, attaching a newTabLayoutMediator
causes the tabs to refresh with the Roboto font instead of the app theme's font. When the tabs are loaded for the first time on view creation, the tabs' font comes from the app theme'sfontFamily
attribute.Expected behavior: The font should be the same theme font, both on the initial tab load and any subsequent refreshes.
Source code:
Minimal sample app repro: Run the app and wait 10 seconds for the tab data refresh. My Application.zip
Android API version: Android 13 (API 33)
Material Library version: 1.6.1 (also 1.7.0-beta01)
Device: Pixel 6 Pro