Closed sevdestruct closed 6 years ago
Poor-Man's Dark Mode: Smart Invert ignore already in affect for cover art:
*took photos because you can't screenshot iOS's Smart Invert mode as it just creates screens of how it looks as if it weren't in affect…
So this combined with: How to assign iOS 11's Smart Invert to Home Button (3 clicks), and you've got yourself a fairly accessible preliminary [poor-man's] dark mode for the time being.
Update: With basic support for Smart Invert in the branch, I've moved on to work on the next bit, the proper Dark Mode, and I've got a decent prototype working so far.
I'd say… Dark Mode is roughly 75% Complete? (if I stick with current method in prototype):
* Heads up, the screens above show my latest dark-mode branch merged with the other aesthetic/cosmetic updates and style revisions I previously proposed and submitted via game-library, iPhone-X, and settings-updates branches on my fork (PRs currently pending review/approval/merge with @jasarien master here), but the base dark-mode prototype branches are based on the current master..
STATUS:
Done:
Almost Done:
Not Done:
This still isn't ready for a Pull Request, yet, but thought I'd share my progress…
I would suggest making the text in table view cells a little lighter. There's no diff so not sure how you're changing the theme but I hope it's UIAppearance class.
[[UILabel appearanceWhenContainedInInstancesOfClasses:@[[UITableViewCell class]]] setBackgroundColor:[UIColor lightGreyColor]];
I think this should work. You can make a class that has methods like, +(void)setDarkMode, +(void)setLightMode, that sets all the colors. You could make all sorts of themes this way really.
@JoeMatt, at the moment the prototype branch I have that is furthest along is utilizing a framework called DKNightVersion, but I may continue in my original dark-mode branch to see about not adding an external framework for this, and try some of what you are saying.
I haven't had a chance to continue my work on this since the update last week to the thread with screenshots and status, but I hope to continue on it soon, especially motivated now seeings as my first pull requests were merged into the master now 😄 !
As for the suggestion, I'll consider lightening it a bit. I am intentionally aiming the dark mode to be pretty easy on the eyes, so I am leaning a bit softer on contrast, butI could go a little lighter..
how close is this to being a PR, this looks awesome to have especially for the iPhone X a pure dark mode for Provenance.
@gh0sti, I posted a pretty thorough status update above already… When i find time again I am going to continue, but as stated I might double back and pursue an option that doesn't rely on adding an external framework, which will set me back a bit.
I could strip out the Phase 1 bit as a PR if preferred, which was simply to support Smart Invert setting (that Apple implemented in iOS 11) by flagging the cover art and emulator view not to invert. That is already done. You could use that as a kind of poor-man's dark mode in the meanwhile, depending on how soon it is reviewed, accepted and jsarien commits it. It isn't perfect but was fairly simple to do.
You're also welcome to clone a branch from me in its current working state (it's stable, just unfinished), should be basically current with jsarien master at the moment.
I would go with the poor mans way for now unless apple actually adds dark mode for iOS 12 might be easier to tie into the smart invert for now. I bet they will tie into that API since most app developers are already adding that into their apps like Facebook and such.
@gh0sti I disagree. I don’t think Apple will introduce to iOS a system wide dark theme like on tvOS or provide a specific API for implementing dark mode specifically. A number of versions ago (iOS 6, maybe?) they introduced the UIAppearence APIs which were intended for theming apps. I believe this is Apple’s solution and it’s down to developers to write a theme using UIAppearence to support a ‘dark mode’. I guess tvOS got special attention as it was new and easy to add a system wide dark theme as there were basically no apps.
Also, the issue with smart invert is that it’s only a ‘dark mode’ for apps with a light theme in the first place. Any apps that already have dark styling will appear bright when in smart invert.
iPhone's also have the ability to lighten/darken the screen and have night shift. I suspect 'dark mode' was added to Apple TV since it's not as easy to control their brightness in dark lighting. jasarien is correct, the proper way to do this is UIAppearence as I already mentioned. Really shouldn't be that hard, there aren't a lot of UI elements in the app.
@sevdestruct I added the start of a Swift UIAppearance theming engine on a new branch, https://github.com/jasarien/Provenance/tree/feature/SwiftThemes
It's just a start, but you can see how it works for now.
Thanks @JoeMatt. That's going to help when we lock on new UI and move into second part of that effort.
For everyone else, as Update to this Issue: dark mode is being rolled into the new UI redesign project as default theme so far (light may become the optional, so I may not continue this branch as it were, and also Joe has the new Swift framework for what we'll use moving forward started which I intent to build on once designs are further along. More to come on that later.
All done
This is the one thing that didn't get reimplemented that my branch had:
Why bother with smart invert if we have an actual dark theme?
@jasarien: Because it still inverts the cover art and entire emulator view stupidly if someone is using that to make other apps dark. And I knew how to do it, so it's done. The other reason is I extended UIView so we can more easily turn this ignore on for all the views since we are Dark Mode default now …or in the event that we add themes, we can do it just for the Dark Mode theme and not light ones.
…or, @jasarien said another way…
(already committed and pushed to UIRedesign branch)
(deny Smart Invert on the whole app/theme if we want):
TODO:
Checked the past Issues… Saw that tvOS has support for Dark Mode as of PR #447, via support for tvOS traits (need to enable that on my AppleTV now that I know about it…), but iOS could use the same.
Started a project (Provenance: Dark Mode) for this on my fork, via a dark-mode branch, but it's too early for a commit to the jasarien master branch:
Breaking this into two parts:
Might need support from other GitHub vampires if anyone else is wanting to help out on this…