Questions tagged [android-dark-theme]

Starting from Android Q (API level-29) Android offers a new Dark theme that applies to both the Android system UI and apps running on the device.

136 questions
34
votes
10 answers

how to implement dark mode in flutter

I want to create a flutter app that has 2 light and dark mode themes that change by a switch in-app and the default theme is default android theme. I need to pass some custom color to the fellow widget and I don't want to just config material theme.…
javad bat
  • 2,180
  • 3
  • 17
  • 31
27
votes
5 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); …
16
votes
3 answers

How can I detect programmatically if the Android Device is in Dark Mode?

I'm trying to support the Android Q Dark theme for my Android app and I can't figure out how to import different assets based on the theme I'm currently in. Im using the official DayNight theme for making the dark/light versions and for drawables is…
Izadi Egizabal
  • 449
  • 3
  • 15
14
votes
1 answer

ContextCompat.getColor() ignore NightMode

TL,DR; ContextCompat.getColor() does not use the night colors (values-night/colors.xml) though it should when night mode is enabled. Here is the problem: Hi everyone, So I'm implementing a dark theme for my Android app, I call this to enable it :…
Mathieu de Brito
  • 2,166
  • 2
  • 22
  • 30
9
votes
3 answers

Notification with inverted color with dark mode

On android 10, negative images i.e images with inverted color are displayed in the notification from custom-notification apps when dark mode is enabled. How to prevent that from happening? Notification with light theme: Notification with Dark…
7
votes
3 answers

Disable dark theme in Ionic

I'm designing an Ionic app, and I would like it to have white backgrounds and black texts whether the user has enabled the dark theme or not. This is what I want: However, when I enable the dark theme on an Android phone, it gets automatically…
Aldán Creo
  • 432
  • 4
  • 10
7
votes
1 answer

configuration.setLocale(locale) doesn't work with AppCompatDelegate.setDefaultNightMode

If I set darkmode with AppCompatDelegate.setDefaultNightMode and the system is not dark, then Configuration.setLocale doesn't work. I change the locale, for example, from En to It, all the strings are still displayed in the system language. There…
6
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
  • 1,450
  • 2
  • 18
  • 55
6
votes
1 answer

Dark theme configuration change in Android Q

I want to implement android 10 dark theme in my app , I have these following cases: SYSTEM_DEFAULT, NIGHT_MODE, LIGHT_MODE The problem is when I change theme from night or light to system_default from inside the app and it can not understand whether…
5
votes
1 answer

Why is Android inverting some of my drawables for dark theme (night) but not others?

My app uses the Theme.AppCompat.DayNight.NoActionBar AppTheme, and has a navigation drawer. All my drawables are XML vectors and the paths in them are black. For the uses of these drawables that are in the menu in my sidenav, something somewhere in…
Eliot
  • 2,189
  • 2
  • 23
  • 40
5
votes
1 answer

Colors of the status bar using the DayNight theme in android

I am applying the theme Theme.AppCompat.DayNight.NoActionBar to my application. In the light theme I want the status bar to be white and in the dark theme I want it to be dark. I can't get the status bar to be white and the letters to be dark and…
Sergio76
  • 3,594
  • 13
  • 55
  • 84
5
votes
1 answer

Enable Night mode for Preview by default

I have about three hundred layouts in my application and I want to implement dark theme for it. Currently, I am trying to find out if there any errors that are related to background colors. In order to do that, I looking through all my layouts one…
Evgenii
  • 105
  • 3
5
votes
1 answer

react native force light mode in android app

when I run my react native app in the emulator (pixel android 10), I noticed that the app change the white background to black when the phone set to dark mode. this made hard to read the black text or anything else. is there a way that forces the…
5
votes
2 answers

Using dark mode with a webview

I can't seem to be able to get android web view to use dark theme or use @media (prefers-color-scheme: dark) I am using AndroidX with DayNight theme Does anyone has a solution that is backward compatible before api 29?
Abdelrhman Talat
  • 913
  • 1
  • 8
  • 21
5
votes
3 answers

Dark mode colors for Flutter

In the site material.io it is written that: To create branded dark surfaces, overlay the primary brand color at a low opacity over the recommended dark theme surface color (#121212). The color #1F1B24 is the result of combining the dark theme…
1
2 3
9 10