Provenance-Emu / Provenance

iOS & tvOS multi-emulator frontend, supporting various Atari, Bandai, NEC, Nintendo, Sega, SNK and Sony console systems… Get Started: https://wiki.provenance-emu.com |
https://provenance-emu.com
Other
5.97k stars 689 forks source link

Feature Request: Dark Mode for iOS #652

Closed sevdestruct closed 6 years ago

sevdestruct commented 6 years ago

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:

screen shot 2018-01-14 at 11 37 29 pm

Breaking this into two parts:

  1. Smart Invert Support (what i call the poor man's dark mode) -- already got a initial start to this with an ignore Smart Invert for covert art, and emulator view so far…
  2. …and potentially a proper Dark Mode [theme] setting, that will restyle everything

Might need support from other GitHub vampires if anyone else is wanting to help out on this…

sevdestruct commented 6 years ago

Poor-Man's Dark Mode: Smart Invert ignore already in affect for cover art:

screen_shot_2018-01-14_at_11_45_58_pm

*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.

sevdestruct commented 6 years ago

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):

screen shot 2018-01-16 at 8 18 42 pm screen shot 2018-01-16 at 8 18 57 pm screen shot 2018-01-16 at 8 19 23 pm screen shot 2018-01-16 at 8 19 43 pm

* 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…

JoeMatt commented 6 years ago

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.

sevdestruct commented 6 years ago

@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..

gh0sti commented 6 years ago

how close is this to being a PR, this looks awesome to have especially for the iPhone X a pure dark mode for Provenance.

sevdestruct commented 6 years ago

@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.

gh0sti commented 6 years ago

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.

jasarien commented 6 years ago

@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.

JoeMatt commented 6 years ago

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.

JoeMatt commented 6 years ago

@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.

sevdestruct commented 6 years ago

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.

JoeMatt commented 6 years ago

All done

sevdestruct commented 6 years ago

This is the one thing that didn't get reimplemented that my branch had:

jasarien commented 6 years ago

Why bother with smart invert if we have an actual dark theme?

sevdestruct commented 6 years ago

@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.

sevdestruct commented 6 years ago

…or, @jasarien said another way…

because this is Bad:

smartinvertlogic-bad

…and this is Better:

(already committed and pushed to UIRedesign branch) smartinvertlogic-better

…and this is probably Best:

(deny Smart Invert on the whole app/theme if we want): smartinvertlogic-best