Closed RakaDoank closed 1 year ago
Hi @RakaDoank Are you on the latest library version? I'm not able to reproduce this issue
Also, are you using the itemTextAppearance
attribute to change the font of the menu items?
@imhappi No, i didn't do "style" at all to the menu items
related dependencies:
com.google.android.material:material:1.9.0
androidx.drawerlayout:drawerlayout:1.2.0
androidx.navigation:navigation-fragment-ktx:2.5.3
androidx.navigation:navigation-ui-ktx:2.5.3
I'm still not able to repro this issue unfortunately, but here are some things that I can potentially think of:
Can you try setting itemTextAppearance
to text appearance with the font you are using? Ie.
<style name="foo">
<item name="fontFamily">@font/montserrat_medium</item>
</style>
and setting itemTextAppearance=@style/foo
on the NavigationView; I'm not sure why the text is the correct font initially and changes, but the NavigationView items have their own text appearance specified in the material style.
It could also be related to the font; when a navigation view item is clicked, it changes all of the checked
items to bold
, and all of the unchecked
items to normal
. Make sure that there is a normal and bold style available for the font.
Yes finally, thank you.
The menus font is never changed anymore, by setting app:itemTextAppearance=@style/Theme.Material3.DayNight.NoActionBar
.
It could be also that you mentioned, i checked Navigation drawer specs, and it is correct checked items will be '500' weight. I didn't set definition style for the font weight variants. @font/montserrat_medium
i used, it was just a font base.
Help me, i don't know why this is happened. I didn't make any change even listening to click listener since the
android:id
attribute is tied/matched with navigation.The menus text will be reverted to default font again after i clicked a menu.
https://github.com/material-components/material-components-android/assets/23445738/09082cf4-24a3-4d7f-94cd-4ce703823b8b
but, the menus text will showing with correct font again after i switched Light/Dark theme. (sorry for the mosaic)
Here my themes.xml file looks like