unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.89k stars 719 forks source link

Wrong color applied on Xiaomi devices running MIUI with Android 10 #11803

Open Youssef1313 opened 1 year ago

Youssef1313 commented 1 year ago

Current behavior

Have any element with background hard-coded to white and install the APK on Xiaomi device running with dark mode with Android 10 (maybe later versions as well). The actual background becomes black.

This is not expected because I'm hardcoding the color, not using any theme resources.

This is a MIUI-specific issue. There is a workaround here https://stackoverflow.com/questions/72404728/android-xiaomi-android-10-mode-night-follow-system-wrong-color-when-phone-sy, but I haven't yet tested it, and I'm not sure if it can cause other issues.

See also https://stackoverflow.com/questions/57175226/how-to-disable-night-mode-in-my-application-even-if-night-mode-is-enable-in-andr/64339016#64339016

Note: In MIUI, if you went to display settings, you find a "More Dark mode options", there you can toggle individual apps. When I installed the Uno app from APK, it was enabled by default in individual apps. Turning it off fixes the issue.

image

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

MartinZikmund commented 1 year ago

I have seen this also on @morning4coffe-dev phone, there must be a way to ignore this "vendor dark mode" and just apply proper dark theme on the application side 🤔