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

Dynamic theme switching #170

Merged
merged 22 commits into from
Jun 27, 2023
Merged

Conversation

janniklasfreundt
Copy link
Contributor

@janniklasfreundt janniklasfreundt commented Jun 9, 2023

To switch themes, just shake the device or Simulator:

Simulator Screen Shot - iPhone 14 Pro - 2023-06-26 at 16 48 36

@michael-zimmermann michael-zimmermann self-assigned this Jun 12, 2023
@michael-zimmermann michael-zimmermann added the Blocked Can't continue working on it at this moment label Jun 12, 2023
Copy link
Contributor

@michael-zimmermann michael-zimmermann left a comment

Choose a reason for hiding this comment

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

.


let bodyFontMetrics = UIFontMetrics(forTextStyle: .body)
let padding = bodyFontMetrics.scaledValue(for: self.spacing.medium) - self.controlBorderWidth
let wideSpacing = bodyFontMetrics.scaledValue(for: self.spacing.xxxLarge) - self.controlBorderWidth
Copy link
Contributor

Choose a reason for hiding this comment

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

I added the wideSpacing here. According to the specs, the spacing is to be xxxLarge when the label is left aligned.

Copy link
Contributor

Choose a reason for hiding this comment

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

good catch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for fixing :)

@@ -230,20 +238,20 @@ public final class CheckboxUIView: UIView {
case .right:
textLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
textLabel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 0).isActive = true
self.textLabelTrailingConstraint = textLabel.trailingAnchor.constraint(equalTo: controlView.leadingAnchor, constant: -padding)
self.textLabelTrailingConstraint = textLabel.trailingAnchor.constraint(equalTo: controlView.leadingAnchor, constant: -wideSpacing)
Copy link
Contributor

Choose a reason for hiding this comment

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

I added a wider spacing, when the label is left aligned.

@michael-zimmermann michael-zimmermann removed their assignment Jun 13, 2023
@michael-zimmermann michael-zimmermann removed the Blocked Can't continue working on it at this moment label Jun 13, 2023
@michael-zimmermann michael-zimmermann force-pushed the feature/demo/dynamic-theme-switching branch from 19ed4ae to d64c313 Compare June 13, 2023 13:16
Copy link
Contributor

@LouisBorleeAdevinta LouisBorleeAdevinta left a comment

Choose a reason for hiding this comment

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

Why are there accent-colors (in the xcassets file) like accent was a SparkColorToken? 🤔


let bodyFontMetrics = UIFontMetrics(forTextStyle: .body)
let padding = bodyFontMetrics.scaledValue(for: self.spacing.medium) - self.controlBorderWidth
let wideSpacing = bodyFontMetrics.scaledValue(for: self.spacing.xxxLarge) - self.controlBorderWidth
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch

@janniklasfreundt janniklasfreundt merged commit c292bbf into main Jun 27, 2023
@janniklasfreundt janniklasfreundt deleted the feature/demo/dynamic-theme-switching branch June 27, 2023 08:43
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.

3 participants