How can I recolor texts and icons that exist in androidx.preference, BottomNavigationView, and DrawerLayout automatically when the user changes theme

Viewed 15

The user can change the appearance of the app from the SettingsFragment.

The SettingsFragment built using androidx.preference

When the user changes the appearance from the app settings, onConfigurationChanged will be called instead of recreating the activity.

That means I should set the colors to texts and icons that exist in androidx.preference, BottomNavigationView, and DrawerLayout by myself.

I want to ask if is there any way to recolor texts and icons that exists in androidx.preference, BottomNavigationView, and DrawerLayout automatically not manually.

Manifest

<activity
    android:name=".activities.MainActivity"
    android:configChanges="uiMode">

...

</activity>

I don't know if the question is clear or not. Ask me if anything is not clear. Thank you.

0 Answers
Related