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
4
votes
2 answers

Use a different image if Dark Mode is enabled on Android

I have two variants of a PNG, one where the drawn text is black and one where it is white. By default, on a white background, I am using the black image variant, but when the system dark mode is enabled the image becomes nearly invisible against the…
muad-dweeb
  • 372
  • 2
  • 16
4
votes
3 answers

Android - theme.xml and theme.xml(night)

In newer version of Android Studio In values directory there is theme.xml and theme.xml(night) Can any point out differences between them ?? Does it replace styles.xml ??
4
votes
3 answers

How to disable automatic change of day night theme based on android system settings?

So far I have learnt from google, you have to use Theme.Appcompat.Daynight or Material Daynight theme to make your app support dark mode. And you need to use different styles.xml in values and values-night directories. I am not willing to make my…
4
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?
4
votes
1 answer

How use dark mode and different resolution assets images in flutter?

I use in my flutter project images with different resolutions as its described here. Now I want to add custom images for dark mode theme. My assets declaration in pubspec.yaml look like this: flutter: uses-material-design: true assets: -…
Szamot
  • 345
  • 2
  • 10
4
votes
1 answer

Icons in Preference Fragment not adapting to night mode

I'm wirting a android app and wanted to make a SettingsActivity. The problem I have that my vector drawable won't adapt it's color to night or day theme. ic_palette_black_24dp.xml:
4
votes
3 answers

WebView resetting UiMode and breaking dark theme

Our app relies on AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES) to make us pick up Light and Dark theme colors from values/colors and values-night/colors But every time we try to use the WebView, it starts by resetting the…
4
votes
1 answer

Dark Theme in android 9.0 changes my app layouts ugly

I am just designing my layout without expecting any of the problems, but one-day android 9.0 launched and I brought the phone and installed my app in it and tried my app opening it with night mode ON and I started to see white color layout changes…
user11640233
  • 41
  • 1
  • 5
3
votes
5 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
  • 111
  • 1
  • 7
3
votes
1 answer

AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM not working

Edit: Updated in the bottom I'm calling this in Application's onCreate: AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) Then when I'm going to the device's settings (Settings -> Display -> Night mode (switch:…
Zbarcea Christian
  • 8,320
  • 16
  • 74
  • 124
3
votes
2 answers

How to make a dark mode setting

I am new to android development and I am looking to make a dark mode setting in my application. For this I created a "preferences.xml" file which is displayed using a "SettingsActivity.java" file and a "SettingsFragment.java" file. I looked for a…
3
votes
0 answers

Android: Previous activity flashes white when changing theme with setDefaultNightMode() (Device Specific)

I am working on an app that has a main activity and a settings activity where the user can manually change the theme to dark mode. I implemented and tested this setting change on my Samsung S8 device and it worked fine. However, I then tested it on…
3
votes
2 answers

How to save dark mode state in android when the app is completely closed

I have a little problem. When I turn on dark mode in my app and then close my app completely in android, when I reopen it, it returns to light mode. I use AppCompatDelegate to do this. I have a settings fragment with a switch to turn on or off dark…
3
votes
0 answers

Triggering Android 10 Theme Update for Widget layout

With the release of Android 10, several widgets (Gmail, Google News, Samsung Email) now update their theme when Dark mode is toggled. I am trying to replicate that behavior. I have a listview widget with an AppWidgetProvider and RemoteViewsFactory.…
Tykin
  • 432
  • 2
  • 8
  • 15
3
votes
1 answer

How to use @media (prefers-color-scheme) in responsive email in Gmail?

Following CSS is in head of HTML email to change email body color when the device in dark mode. @media (prefers-color-scheme: dark) { .white-cont { background: red !important; } } It turns body of email only in apple mail app. Gmail app…
Salitha
  • 596
  • 4
  • 23
1
2
3
9 10