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

Add Dark Mode support and customisation #29

Merged
merged 10 commits into from
Oct 28, 2019
Merged

Conversation

AvdLee
Copy link
Contributor

@AvdLee AvdLee commented Oct 28, 2019

This PR adds support for customization using a TatsiColors protocol. It also adds great support for dark mode by default which might even take away the need to apply custom styling.

  • Dark mode support
  • Color customization
  • Readme updated
  • Schemes added to the example project to make it easier to build

Adding customized colors

This can simply be done by using the TatsiConfig.default.colors property which defaults to TatsiDefaultColors(). Simply create your custom struct applying to the TatsiColors protocol:

/// Defines colors that will be applied to the Tatsi elements.
public protocol TatsiColors {
    var background: UIColor { get }
    var secondaryBackground: UIColor { get }
    var tint: UIColor { get }
    var label: UIColor { get }
    var secondaryLabel: UIColor { get }
}

Albums overview

Light Dark
Screen Shot 2019-10-28 at 11 33 38 Screen Shot 2019-10-28 at 11 33 46

Recents

Light Dark
Screen Shot 2019-10-28 at 11 34 03 Screen Shot 2019-10-28 at 11 33 58

@AvdLee AvdLee requested a review from renssies October 28, 2019 10:45
@AvdLee AvdLee self-assigned this Oct 28, 2019
Copy link
Contributor

@renssies renssies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only 2 small comments, looking good otherwise

}
}()

public var tint: UIColor = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would rename this to link as well since you are using the link color instead of the tint color.


/// Defines colors that will be applied to the Tatsi elements.
public protocol TatsiColors {
var background: UIColor { get }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick description of where each color is used or what it's used for would be great.

@renssies
Copy link
Contributor

renssies commented Oct 28, 2019

Ow and it would also be great if you could enable dark mode in the Example app as well, it just means changing the background colors :)

Correction: Just fixed this for you, it wasn't that much work 😛

@AvdLee AvdLee requested a review from renssies October 28, 2019 12:32
@renssies renssies merged commit df7896b into master Oct 28, 2019
@renssies renssies deleted the feature/dark-mode-support branch October 28, 2019 12:41
@AvdLee AvdLee mentioned this pull request Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants