125 questions
0
votes
0
answers
82
views
Incorrect app widgets theming after manual switching the dark theme in Android
I'm trying to implement dark theme in my app using this doc as a guide.
My app uses Theme.MaterialComponents.DayNight.NoActionBar theme and there is values-notnight resource folder for colors in light ...
1
vote
0
answers
126
views
Android WebView Theme Issue: Forced Light or Dark Mode lead Mixed UI Components After WebView Closure
I am experiencing an issue in my Android app related to using WebView in a fragment while forcing a theme mode opposite to the system's current mode. When the system is in dark mode, I force light ...
1
vote
0
answers
114
views
Developer option force dark mode changes app colors
I've created an app which is working as expected. The app is only running on an Android device with a dark mode theme, and should always appear dark.
I did notice one small visual bug I would like to ...
1
vote
0
answers
98
views
Can't get my widget to redraw when dark mode is turned on/off
I want my widget to change font color when the user switches darkmode. I have a widget, let's say with a background image and a textview:
<LinearLayout xmlns:android="http://schemas....
1
vote
2
answers
433
views
With enableEdgeToEdge, dark mode doesn't work properly
According to this documentation, if we want to enable edge-to-edge on API 34 and lower devices, we must call this method in the activity:
override fun onCreate(savedInstanceState: Bundle?) {
...
0
votes
1
answer
237
views
Android: Fragment changes when I change to dark theme
I have an activity that uses bottom navigation for fragments and an options menu to choose the theme. The problem is when I change the theme the fragment changes as well to the first one, not the one ...
2
votes
0
answers
235
views
ForceDarkAllowed for specific Compose component or how to fix weird text color in dark mode on some Xiaomi phones?
I have trouble with text color in dark mode on some Xiaomi devices with android 10.
The component is clickable Box with text, if item selected - the text color is back and box is white and vise versa. ...
2
votes
0
answers
490
views
Handling configuration changes in OSMDroid + Jetpack Compose
I'm trying to use OSMDroid library in my Compose Android app. I used this approach and it works great, but when I change to dark mode in my app, the map becomes just a grid, and no tiles are displayed....
1
vote
1
answer
617
views
how to change the background of status bar in react native based on device theme?
How I can change the background of statusbar based on device theme in real time ?
I wrote the following code and I wanted whenever I toggle my device's dark or light mode the statusbar change as well, ...
1
vote
2
answers
672
views
What is difference between Dark Mode and Dark Theme for any website and application?
I am new in UI development, I was asked above question in the interview.
I got confuse because as per my understanding there is no difference. Kindly guide me is there is any difference.
4
votes
0
answers
583
views
Android splash screen api read darkmode based on device setting issue
I use android splash screen api for my app splash screen.
I implemented the dark mode theme for my app and everything is working. But on some devices, like the Samsung devices with Android 13 (API 33) ...
0
votes
1
answer
125
views
Android Play In-App Review pop up not supporting dark mode
How to support dark mode for In-App review flow (review pop up) when application is in dark mode?
I have implemented android play in-app review flow. Flow working correctly but review pop is shown in ...
2
votes
1
answer
832
views
How to prevent Night Theme changing view colors to default colors in android studio?
Actually it seems very easy. I just want my view not to change its color when DARK THEME is applied. But it keeps changing.
I have even created colors/night and edited theme/night to keep my colors.
...
0
votes
1
answer
918
views
I want to change the Android dark mode dynamically
In my Android project currently under development, there are many Fragments in Activity.
And inside the Fragment, RecyclerView is used to show multiple Items to the user.
What I want is that when the ...
0
votes
1
answer
80
views
How to set CSS for dark mode to have still acceptable contrast when phone screen is dimmed?
The dark mode on my web page has a quite different contrast on my mobile phone screen (Android), depending whether the screen is dimmed or not.
Any guidelines to choose colors so that the contrast is ...
39
votes
3
answers
23k
views
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....
0
votes
0
answers
252
views
Dark mode list preference not working. Is dark for a second and then is light
I added adaptive themes in my application using List Preferences and it does not work. Sometimes when I create Build APK and test Preferences, the theme it sets to dark for a second and returns to the ...
1
vote
0
answers
1k
views
Android. Xiaomi (android 10+) mode_night_follow_system wrong color when phone system theme is dark [duplicate]
the problem is:
When I open the application, I set the theme according to the theme of the device. In android code it is = mode_night_follow_system.
Let's imagine that the theme of the system(device) ...
0
votes
2
answers
1k
views
My React Native app is lagging in the light mode, but is superfast in the dark
I am creating a React Native app with light and dark modes. The colors of all components in the app are controlled with my custom hook:
export const useColors = (): UseColorsResult => {
const ...
2
votes
0
answers
445
views
Force light mode on single View
I have an Android app which supports night mode by inheriting the theme from Theme.MaterialComponents.DayNight.NoActionBar. This works perfectly fine.
However, for a specific View, I want to force ...
2
votes
0
answers
318
views
MODE_NIGHT_FOLLOW_SYSTEM not working after MODE_NIGHT_YES
I have the next code to force dark mode depending the store of the user.
if (storeProvider.shouldForceDarkMode) {
appProvider.theme = AppProvider.AppTheme.DARK
AppCompatDelegate....
1
vote
1
answer
3k
views
How to change splash screen in dark mode(Android)?
I created a simple project and added the flutter_native_splash package. I am running this project on my android phone via USB. If my phone is in light mode splash screen works fine. But in the dark ...
0
votes
1
answer
3k
views
Android refusing to disable dark mode
I have a project with two apps written in React Native. Since I do not currently support a dark theme, users with dark-mode enabled on their devices get bad colors in my app. Therefore I want to ...
4
votes
2
answers
5k
views
Dark mode Gmail signature randomly changing PNG (raster) image colours from black to white
I have a Gmail (web app) based email signature with PNG images hosted on a server (please see the code below). I was just updating this signature to accommodate for "dark mode" and suddenly ...
2
votes
0
answers
3k
views
Android Dark/Light mode not working in android
I am implementing Dark/Light mode in android.
Implementated using below code:
Theme: Theme.MaterialComponents.DayNight.NoActionBar
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)...
0
votes
1
answer
488
views
Is there a way not to switch to darkmode while system is in darkmode in jetpack?
I want the same display as in the lightmode when darkmode is on. Is there an easier way without hardcoding every textfields,buttons etc.
1
vote
2
answers
1k
views
System Dark mode setting problem (More Dark mode options)
Hello‚ I had a problem with the night mode in my program. Switching from the phone system to night mode did not change the black text to white. It was just black. I found a solution through ...
1
vote
1
answer
583
views
Xamarin.Android: Reload MainActivity on RequestedThemeChanged
We are trying to implement Dark mode after following this blog. Everything seems to be working except when we try to update the Dark Mode in mobile settings (after the initial launch ). The App in the ...
0
votes
1
answer
1k
views
Android Studio bug with dark mode, some things change, others no
My app has an activity for appearance with a switch to turn dark mode on or off. However, when I change the theme, sometimes it changes everything correctly and sometimes it changes just a few ...
2
votes
1
answer
338
views
Implementing Dark mode on Legacy Android Project
I have a feature requirement to implement dark mode in my old Legacy project which uses a mixture of AppCompact Activities and normal Activities and is roughly more than 1500 files.
I want to ask if ...
0
votes
1
answer
724
views
What's the default background colour res which changes based on dark mode? [Android]
I have a coordinator layout which has a bottom sheet.
By default, my bottom sheet's background is transparent. So I put color/white as the background res for the parent layout.
This works fine in ...
1
vote
1
answer
241
views
Android ExpandableListView not changing to light text in night mode
I am creating an ExpandableListView and its adapter (ExpandableListAdapter, using a SimpleExpandableListAdapter) by doing something like this. It works fine in light mode, but the text remains black ...
2
votes
0
answers
43
views
How to show things different based on theme?
I made some spinners in my activity and made drawable resources for them, but when I turn off dark mode on my phone it looks weird. how can I define things to change when I am not in dark mode.
For ...
0
votes
1
answer
312
views
Dark mode in app is not applying after removing app from recent background
First see this picture below
[white mode 1] https://i.sstatic.net/QKcju.jpg
[white mode 2] https://i.sstatic.net/QKcju.jpg
[Dark mode 1 ] https://i.sstatic.net/QKcju.jpg
[Dark mode 2 ] https://i....
14
votes
2
answers
23k
views
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 ...
0
votes
0
answers
179
views
Changing to Night mode duplicates items in recycler view
In my app i have a settings activity to change app to dark mode with SwitchPreference and when there is change in preference app move to MainActivity - parent activity and the MainActivity ...
12
votes
3
answers
5k
views
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?
-1
votes
1
answer
5k
views
How to fix image view icon color changes in dark mode and lite mode of the device
I'm trying to include icons in imageview but when the dark mode is on the color is dark and when on lite mode its shows in white, I want color to be white in both modes
Vector // icon
<vector ...
0
votes
1
answer
4k
views
How to make Background Color fixed for dark mode and light mode of the device
Hello i want to know that how can i set a fixed color to ui elements wheather the android device is in light mode or in dark mode
Here in my case there are some issues where the View in light mode of ...
2
votes
0
answers
200
views
Disable darkmode for textColor edittext
disabled the dark mode for the application with
<item name="android:forceDarkAllowed">false</item>
But in the input in the case, when you need to remove Span, the textСolor is ...
0
votes
1
answer
55
views
Use attributes in layout
I want to use dark mode in my layout. I have tried this:
attr.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="myColor" format="...
3
votes
6
answers
13k
views
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 ...
2
votes
0
answers
147
views
Android dark mode detection in pure Node.js
I would like to detect dark mode on my android device running Node.js from termux.
Also I can't use electron, phantom.js or any other "rendering" library.
Is it possible?
If not I will ...
4
votes
3
answers
4k
views
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 ...
1
vote
0
answers
42
views
Detect whether a schedule is enabled for Android Night/Dark mode
I'd like to know whether a schedule is enabled to automatically switch day/night themes (ie based on sunset time). Is this possible? I'm building a library, so user interaction is not an option.
...
2
votes
3
answers
3k
views
Cant detect if dark theme is active or not after changing it with AppCompatDelegate
I'm trying to implement an option to let the users specify if they want the app to load the theme based on the system settings (dark or light, i.e., if the device is set to use dark mode or not) but I ...
11
votes
4
answers
12k
views
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 ...
0
votes
1
answer
311
views
Samsung Galaxy S20 broke dark mode sometimes
I have application, which set mode dark mode in Application:
AppCompatDelegate.setDefaultNightMode(isDarkModeOn() ? AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO);
It works ...
0
votes
0
answers
294
views
Android Spinner text color in dark mode
I'm about to implement the dark theme in my Android app.
The problem, I've got is the text color of my selected spinner. -> It is "Black" as the background...
This problem occurs if I set the values ...
1
vote
1
answer
4k
views
Is it possible to use JavaScript to switch between light mode and darkmode on a page?
I can use
@media (prefers-color-scheme: dark)
or
window.matchMedia('(prefers-color-scheme: dark)').matches
to detect whether it's a dark mode the OS.
However, is there any way that I can modify the ...