Questions tagged [android-darkmode]
124 questions
6
votes
3 answers
Change ActionBar text color after inheriting Theme.AppCompat.DayNight
I'm implementing support for dark mode. But after I changed Theme parent to Theme.AppCompat.DayNight, text in Action Bar is black (black in day mode and white in dark mode). I want the text to be always white. I tried to change text color in…

MagogCZ
- 83
- 2
- 8
5
votes
2 answers
Is there a quick way to toggle dark mode in the Android emulator?
I'm mainly using the Android emulator for development. Is there a quick way (ideally a keyboard shortcut) to switch between dark mode and light mode for testing the dark/light themes?

don
- 1,497
- 1
- 13
- 27
5
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…

Sudipta Debnath
- 63
- 1
- 4
5
votes
1 answer
Android - Detect if the user's OS theme is dark or light?
I need to know if user has enabled dark theme in the OS level so that I can enable dark theme in my app automatically.(not force dark mode)

Anu Pramod
- 304
- 1
- 3
- 12
5
votes
1 answer
How do I force darken the WebView parent so that I can use WebSettingsCompat.FORCE_DARK_AUTO?
I've followed the instructions on this super useful answer https://stackoverflow.com/a/61643614/704836 and I have dark mode in the WebView implemented however WebSettingsCompat.FORCE_DARK_AUTO doesn't seem to work when I use…

casolorz
- 8,486
- 19
- 93
- 200
4
votes
3 answers
Android manual dark mode on app resume/restart causes app theme to not work correctly
I'm having a big issue managing dark mode manually.
How does the app work
On application startup the first activity checks in SharedPreferences if the user chose to enable dark mode or to stay in light mode (default), then it changes it accordingly…

x-devel
- 148
- 2
- 11
4
votes
1 answer
How to test the Android Dark Mode using Espresso
What is the best way to test the different DayNight themes on Android using Espresso? (or something better?) I haven't found anything on the internet. I thought this must be something big because of everything migrating to DayNight now.
I want to…

Andre Thiele
- 3,202
- 3
- 20
- 43
4
votes
3 answers
Is it possible to force dark mode splash screen?
I am implementing dark mode and I have a dark mode version of splash screen in drawable-night. Then in app's onCreate I call:
override fun onCreate() {
super.onCreate()
…

mickp
- 1,679
- 7
- 23
4
votes
3 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…

Celoufran
- 93
- 1
- 9
4
votes
1 answer
Dark mode color not resolved correctly in RecyclerView
I am trying to implement night mode, but I have issues: CardView doesn't change color to night value but activity correctly changes its background to night color values.
Please help to understand the issue.
MainActivity
public class…

goraga1
- 167
- 12
4
votes
8 answers
Can we have Android Dark Mode Support for App Icons?
I am trying out with Dark Mode Theme Support for Android 10 for my App.
I am able to work with all other things in Dark Mode except App Launcher Icon.
For reference, I was using below link…

Rahul
- 352
- 1
- 4
- 17
4
votes
1 answer
How to detect darkmode on Samsung Internet browser?
If this can be detected - is there a possibility to influence colors by CSS classes or JavaScript?
With the dark reader extension, it is also possible to submit adjustments. Hope that it is also possible here, if nothing else could change it.

still
- 73
- 1
- 5
4
votes
1 answer
Android - Dark Mode for Custom Notifications
i have a Notification with a custom XML-Layout, therefore i can't use default Styles like MessagingStyle or MediaStyle.
The problem is, that the Notification Stays white, even if Dark Mode is on, which is quite annoying.
I checked the Source Code of…

metinkale38
- 718
- 3
- 10
- 28
3
votes
6 answers
Disable Dark Mode Programmatically in Android
I want to disable darkmode in app based on a flag Programmatically. I have defined custom colors in the values-night folder for darkmode.
I have tried the following solutions for disabling darkmode but not…

Shyam
- 871
- 6
- 15
- 30
3
votes
1 answer
Android ActionBar/Toolbar colors different in Light vs Dark themes
I am trying to understand why the ActionBar is styled differently in Light vs Dark themes. Below is a simple settings screen that can toggle between Light and Dark themes with identical themes.
values\themes.xml

Devin Rodriguez
- 1,144
- 1
- 13
- 30