Questions tagged [android-darkmode]

124 questions
51
votes
7 answers

How to enable night mode programmatically?

I am looking for a way to enable night mode programmatically with an Android code: public static void setNightMode(Context target, boolean state){ UiModeManager uiManager = (UiModeManager) target.getSystemService(Context.UI_MODE_SERVICE); …
23
votes
2 answers

Android Jetpack Compose Preview UI_MODE_NIGHT_YES does not show dark background in preview

I am following https://developer.android.com/jetpack/compose/tutorial and the code @Preview(name = "Light Mode") @Preview(name = "Dark Mode", uiMode = Configuration.UI_MODE_NIGHT_UNDEFINED, showBackground = true) @Preview(name = "Full Preview",…
rofrol
  • 14,438
  • 7
  • 79
  • 77
23
votes
4 answers

How can I change between night mode and light mode on Android Studio preview?

I'm starting to implement dark mode on my app and I'm using Theme.AppCompat.DayNight.NoActionBar. Everything is working fine on the device but I want to see the differences on the Android Studio so I don't have to keep running the code in order to…
12
votes
3 answers

Android Activity is getting instantiate twice while using Dark Mode

My launcher activity i.e. MainActivity is getting instantiated twice while using AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) which is leading to two network calls and making weird behavior. Is there any to control this…
9
votes
2 answers

Android Colors in Dark Mode

Hello fellow developers. I've developed and Android App using Android Studio, but I only took into account the layout themes for light mode. Here's how it looks: So now, when I switch my phone to dark mode, this happens: How can I change the…
Alcachofra
  • 135
  • 1
  • 1
  • 6
9
votes
2 answers

Android: inverted color on dark mode

I have troubles with some imageview on certain Android phones. It seems that the dark mode invert the color of certains assets (not all, it seems only black/dark gray ones) An example. I cannot find a way to avoid this. Is there some kind of…
Davide Berra
  • 6,387
  • 2
  • 29
  • 50
9
votes
7 answers

Android - Dark mode issue: black text on dark background

When I enable the dark mode some menu on my app looking bad: black text on very dark background. I'm totally a beginner on color things. I never touched anything on the default color settings on android studio yet, so I have the default two themes…
Andry
  • 323
  • 1
  • 2
  • 10
9
votes
1 answer

Is there any specific resource folder in android for dark mode drawables only?

When I turn on dark mode in my app, the icon of some dialogs is not visible because they are dark. I created those drawables with the "New Image Asset" option in the Android studio. is there any specific resource folder for dark mode drawables?
8
votes
4 answers

Jetpack Compose TextField text colour in dark mode

I've been experimenting with Jetpack compose and I've noticed that although the text colour updates correctly for Text when you switch to dark mode, the text colour for TextField or OutlinedTextField remains stubbornly black. The labels and hint are…
8
votes
2 answers

Android DarkMode : Value night not working

I am developing Day/Night feature in my app so I read those documents and start developing it. It's working fine with default value in Day or Night with deligate method AppCompatDelegate.setDefaultNightMode(*). For customize night theme color I…
Mohit Suthar
  • 8,725
  • 10
  • 37
  • 67
7
votes
1 answer

Android: How to switch theme for dark mode?

Since Android 10, you can switch between dark mode and default light mode. I didn't make any closer research yet on this since it's a new topic. Is Dark mode color switching automatic by OS or is there any way to tell my App to switch different…
martin1337
  • 2,384
  • 6
  • 38
  • 85
7
votes
2 answers

Android 10 Notification Images in Dark Mode looks like a negative image

Android 10 Notification in Dark Mode looks like a negative image Note: am not target my app to android 10 (API 29) minSdkVersion 17 targetSdkVersion 28 Android 10 notification is shown below In API 28 Dark Mode working fine
6
votes
3 answers

Xamarin app automatically switching to dark mode on Android device with dark mode on

my Xamarin.Forms app (Shell project) keeps automatically switching to dark theme when on an Android phone with dark theme enabled. I don't want this to happen. I tried multiple ways to disable this, but none of them worked. Any idea what's…
6
votes
4 answers

How to force disable android dark mode in React Native

I made one app in react-naive using "react-native": "0.62.0", "react": "16.11.0", as I put my android device in dark mode, my UI designs get disturbed so i want to make it disable for now. please help.
cakePHP
  • 425
  • 1
  • 4
  • 23
6
votes
1 answer

Android. Using dark themed colors in Light Theme

I'm using Theme.Material.Components.DayNight theme to implement dark mode in my app. The problem is my dark mode will be purely compounded with dark components while my "light" mode will be coumpounded with mixed dark and light components. So i need…
1
2 3
8 9