Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Implement Dark Mode support #80

Open
2 tasks
CristiHabliuc opened this issue Sep 27, 2019 · 10 comments
Open
2 tasks

[UI] Implement Dark Mode support #80

CristiHabliuc opened this issue Sep 27, 2019 · 10 comments

Comments

@CristiHabliuc
Copy link
Contributor

CristiHabliuc commented Sep 27, 2019

This would require a more flexible color configuration, meaning:

  • Colors should now be stored in asset catalogs we can't because of the minimum deployment version (9.3). We should implement the logic in the UIColor extension for light/dark mode colors.
  • Set colors for light + dark mode for each defined color
@CristiHabliuc CristiHabliuc changed the title Implement Dark Mode support [UI] Implement Dark Mode support Sep 27, 2019
@pankova
Copy link

pankova commented Oct 1, 2019

Hi! I would like to help you with it as part of Hacktoberfest

@CristiHabliuc
Copy link
Contributor Author

@pankova do you think can you take care of this one?

@pankova
Copy link

pankova commented Oct 2, 2019

I would be glad to help you with this feature :)

@CristiHabliuc
Copy link
Contributor Author

Awesome! Before you start, please read our git workflow if you haven't contributed to our projects before. Looking forward to see the progress. Cheers!

@pankova
Copy link

pankova commented Oct 17, 2019

@CristiHabliuc hi! Could you please give me test app auth data to go through all screens without a lot of difficulties? :)

@pankova
Copy link

pankova commented Oct 17, 2019

i tried test auth from other issue thread (0722222222 123456), but it's invalid
Screenshot 2019-10-17 at 22 55 59

@aniri
Copy link
Member

aniri commented Oct 17, 2019

@pankova that account is correct. please make sure you are using the latest code from the develop branch. and also that the backend api that you are calling is https://mv-mobile-dev.azurewebsites.net

@pankova
Copy link

pankova commented Oct 17, 2019

the problem was with prod url, thx!

@ghost
Copy link

ghost commented Nov 21, 2019

This should be fixed with Pull Request

@ghost ghost mentioned this issue Nov 21, 2019
@aniri aniri removed the ios label Jan 12, 2020
@magyarosibotond
Copy link

Since the use of asset catalogs is out of scope due to the support for older versions of iOS, I'd suggest to keep the current structure of UIColor+Presets.swift and create an extension with different behaviours on older OS versions.

public extension UIColor {
    convenience init(defaultHex: UInt32, darkHex: UInt32) {
        if #available(iOS 13.0, *) {
            self.init { traitCollection in
                if traitCollection.userInterfaceStyle == .dark {
                    return .init(hexCode: darkhex)
                }
                return .init(hexCode: defaultHex)
            }
        }
        else {
            self.init(hexCode: defaultHex)
        }
    }
}

By doing this pre iOS 13 versions will fall back to the default color scheme while new versions will have support for both. This solutions does not require any change in the rest of the application.

Since all the images are PNG based some of them will require re-export in either PDF format (for template rendering mode) or a dark mode friendly version (similar extension required).

I'm happy to make this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants