Native Bottombar Styling

0
Hi all,   I have a Native App for which I disabled dark mode in the Custom Variables JS simply by using the following statement:   export const darkMode = false;   This used to work just fine. However, since I migrated to version 10.12, the background of my bottom bar navigation within the Native App does show two 'versions' of colors. The color of the bottom bar changes based on the device's theme setting (light/dark mode). This is something I do not want, I want my bottom bar to have the same color no matter the theme settings. I'm certain that the new Navigation profile updates for Native have made this issue arise.   Does anyone know a workaround to fix this?
asked
1 answers
1

Hi Martijn Muskens,

To permanently disable dark mode in your Android app, you can update the code in your MainActivity.java file.

 

// Checks the current theme and applies the correct style (Backwards compatible)boolean isDarkMode;

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {    isDarkMode = getResources().getConfiguration().isNightModeActive();} else {    isDarkMode = AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES;}

setTheme(isDarkMode ? R.style.AppTheme : R.style.AppTheme_Dark);

 

Open Android studio and Check on the below lines in MainActivity.java and Just Comment these code and Replace it with,

 

AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);

 

answered