monitorizare-vot-ios
monitorizare-vot-ios copied to clipboard
[UI] Implement Dark Mode support
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
Hi! I would like to help you with it as part of Hacktoberfest
@pankova do you think can you take care of this one?
I would be glad to help you with this feature :)
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!
@CristiHabliuc hi! Could you please give me test app auth data to go through all screens without a lot of difficulties? :)
i tried test auth from other issue thread (0722222222 123456), but it's invalid
@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
the problem was with prod url, thx!
This should be fixed with Pull Request
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.