material design이 복잡해서 문서를 참고하시면 좋을 것 같네요.
https://material.io/components/navigation-drawer/android#anatomy
위 페이지에서
4. Active text overlay
5. Active text
원하시는 부분인 것 같네요.
Text Atribute 섹션을 보면
Color | app:itemTextColor | setItemTextColor getItemTextColor | ?attr/colorPrimary when active else ?attr/colorOnSurface (see all states) |
app:itemTextolor 속성을 지정하라고 되어 있네요. 아이템 선택시 기본값으로는 colorPrimary의 색깔을 사용한다고 되어 있습니다. 현재 colourOnSurface가 흰색으로 되어 있으신 듯 하네요. 이걸 변경하시던가, 따라서 아래처럼 NavigationDrawer의 스타일을 하나 정의하고 이걸 가져다 사용하시면 되지 않을까 생각합니다.
theme.xml
<style name="DrawerTheme" parent="Widget.MaterialComponents.Toolbar.PrimarySurface">
<item name="android:background">@color/white</item>
<item name="colorOnPrimary">@color/wanted_color</item>
</style>
<com.google.android.material.navigation.NavigationView
style="@style/DrawerTheme" <!-- 여기에 정의된 style 사용 -->
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />