Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird UI on Android 13 #545

Open
neilanthonyte opened this issue Jun 27, 2023 · 9 comments
Open

Weird UI on Android 13 #545

neilanthonyte opened this issue Jun 27, 2023 · 9 comments

Comments

@neilanthonyte
Copy link

Screenshot 2023-06-28 at 7 47 36 AM

The UI looks weird on android 13 . . is there a way to correct this? Thanks

@neilanthonyte
Copy link
Author

apparently the phone was set to dark mode . . is there a way to not follow the phone settings?

@Nantris
Copy link

Nantris commented Sep 5, 2023

Agreed it should have a way to opt out of the system preferences. Users make exceptions for some apps (if the app offers an option) and this breaks that model.

@vonovak
Copy link
Contributor

vonovak commented May 30, 2024

Hi!
I think this package could help: https://github.com/vonovak/react-native-theme-control

@Kasendwa
Copy link

@vonovak actually this package doesn't resolve the matter. I have it installed but still menu items return in black against the dark background for dark mode.

@Kasendwa
Copy link

My bad @vonovak. Something was setting the static color in the base AppTheme. So, even the library stood no chance at fixing this.

Resolved now. You're right.

@fredrikburmester
Copy link

Hi, could you expand on how you solved this, I have the same issue. @Kasendwa

@Kasendwa
Copy link

Kasendwa commented Nov 25, 2024

Hi, could you expand on how you solved this, I have the same issue. @Kasendwa

Hi @fredrikburmester do you use Expo CNG or bare react native?

@fredrikburmester
Copy link

I use Expo. We solved it using a custom plugin and changing the styles.xml directly.

const { readFileSync, writeFileSync } = require("fs");
const { join } = require("path");
const { withDangerousMod } = require("@expo/config-plugins");

const withChangeNativeAndroidTextToWhite = (expoConfig) =>
  withDangerousMod(expoConfig, [
    "android",
    (modConfig) => {
      if (modConfig.modRequest.platform === "android") {
        const stylesXmlPath = join(
          modConfig.modRequest.platformProjectRoot,
          "app",
          "src",
          "main",
          "res",
          "values",
          "styles.xml"
        );

        let stylesXml = readFileSync(stylesXmlPath, "utf8");

        stylesXml = stylesXml.replace(/@android:color\/black/g, "@android:color/white");

        writeFileSync(stylesXmlPath, stylesXml, { encoding: "utf8" });
      }
      return modConfig;
    },
  ]);

module.exports = withChangeNativeAndroidTextToWhite;

@ice-cap0
Copy link

ice-cap0 commented Jan 1, 2025

seeing this exact issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants