How to Force Dark Mode?
Moderator: Martin
How to Force Dark Mode?
My Samsung Galaxy Note 10+ has an option under Settings > Developer options > Force Dark mode. This forces all apps (even those which don't have a native Dark Mode) to use a "dark mode" setting.
Unfortunately this setting unsets itself every time I reboot my handset, so I have to manually turn it back on.
I'd like to get Automagic to do this for me. I can use Start Activity with android.settings.APPLICATION_DEVELOPMENT_SETTINGS in the action field to open Developer Options, but can't see any way to toggle Force Dark Mode.
Is this possible?
Unfortunately this setting unsets itself every time I reboot my handset, so I have to manually turn it back on.
I'd like to get Automagic to do this for me. I can use Start Activity with android.settings.APPLICATION_DEVELOPMENT_SETTINGS in the action field to open Developer Options, but can't see any way to toggle Force Dark Mode.
Is this possible?
--
Philip
Philip
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: How to Force Dark Mode?
Hello,
It may be possible with additional information in the START ACTIVITY action. I cannot help you with that.
Normally CONTROL UI action would provide a solution but the Overlay Control doesn't work with Settings pages. So you can't get the toggle switch information.
However, one crude (and it's very crude) solution is to use the gesture recorder to record swipes up and a swipe across. This will simulate the actions you do when changing the setting manually.
You can't record the gestures on the settings page, but you can on the Automagic screen. A lot of trial and error is involved to get it right. I would wait to see if someone can provide the information required for START ACTIVITY settings.
Good luck
Micky
It may be possible with additional information in the START ACTIVITY action. I cannot help you with that.
Normally CONTROL UI action would provide a solution but the Overlay Control doesn't work with Settings pages. So you can't get the toggle switch information.
However, one crude (and it's very crude) solution is to use the gesture recorder to record swipes up and a swipe across. This will simulate the actions you do when changing the setting manually.
You can't record the gestures on the settings page, but you can on the Automagic screen. A lot of trial and error is involved to get it right. I would wait to see if someone can provide the information required for START ACTIVITY settings.
Good luck
Micky
Crude but it works.
Re: How to Force Dark Mode?
Hello, Philip.
I have an idea that you can use Action: Set System Setting to change the setting that make your phone to force dark mode if it exist.
You can find it yourself.
Another way you can try this to find that setting if it is exist: Secure Setting Logger
I have an idea that you can use Action: Set System Setting to change the setting that make your phone to force dark mode if it exist.
You can find it yourself.
Another way you can try this to find that setting if it is exist: Secure Setting Logger
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: How to Force Dark Mode?
Hello
The setting exists on my Samsung S10
display_night_theme
But it only toggles the setting, it doesn't activate it.
Nice approach if it did work. Still worth trying as results can vary depending on the phone.
Thank you
Micky
The setting exists on my Samsung S10
display_night_theme
But it only toggles the setting, it doesn't activate it.
Nice approach if it did work. Still worth trying as results can vary depending on the phone.
Thank you
Micky
Crude but it works.
Re: How to Force Dark Mode?
Most of the time, setting in the developer option are protected by special API. You might need to open the setting page again to force the system reread the secure setting you have changed.
The other way is to open the development setting, use the control UI scrollForwardById(elementid) several times until the designated toggle and then use clickById() or other type to toggle the dark mode. If you don't restart the mode frequently, some UI distraction at every reboot should be tolerable.
The other way is to open the development setting, use the control UI scrollForwardById(elementid) several times until the designated toggle and then use clickById() or other type to toggle the dark mode. If you don't restart the mode frequently, some UI distraction at every reboot should be tolerable.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: How to Force Dark Mode?
Hello,
Control UI can't use the overlay on settings pages.
Try it.
Micky
Control UI can't use the overlay on settings pages.
Try it.
Micky
Crude but it works.
Re: How to Force Dark Mode?
@Micky : I just tested it, scrollForward() works fine in the developer options. I don't know with other phone/ROM, but it is working at my RN5 Whyred, with ROM AEX 6.7, based on Pie 9.0. Maybe some other ROM protect the setting pages or flagged it as secure, so can't be accessed by Accessibility.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: How to Force Dark Mode?
Desmanto,
You can't use ClickById etc because the overlay function of Control UI doesn't work in that settings page. Unless you know another way.
Yes you can scroll about, that's what my original suggestion was explaining. My method involves a bit of trial & error to move down to the correct point and the swipe across on the toggle switch for dark mode.
(BTW I'm quite proud of the crudeness of it)
Micky
You can't use ClickById etc because the overlay function of Control UI doesn't work in that settings page. Unless you know another way.
Yes you can scroll about, that's what my original suggestion was explaining. My method involves a bit of trial & error to move down to the correct point and the swipe across on the toggle switch for dark mode.
(BTW I'm quite proud of the crudeness of it)
Micky
Crude but it works.
Re: How to Force Dark Mode?
Try Control UI in the developer option menu, i got something like this when I click on the "System UI demo mode"
Of course, this is at my phone. It might be different in other phone/ROM.
From there, I can use scrollForwardByld("android:id/title"). I can loop this several times to reach the setting I want.Of course, this is at my phone. It might be different in other phone/ROM.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: How to Force Dark Mode?
Lucky you.
Any settings page on my S10 causes the overlay controls to disappear.
Maybe the OP can see it on their phone. If so, then you can help.
Many thanks
Micky
Any settings page on my S10 causes the overlay controls to disappear.
Maybe the OP can see it on their phone. If so, then you can help.
Many thanks
Micky
Crude but it works.