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

[vNext] Tokenize Segmented Control #940

Merged

Conversation

huwilkes
Copy link
Collaborator

@huwilkes huwilkes commented Mar 9, 2022

Platforms Impacted

  • iOS
  • macOS

Description of changes

Convert the Segmented Control to a tokenized control. Also update the demo controller to support the new theme/token overrides.

Verification

Before After
SegmentedControl_before_light SegmentedControl_after_light
SegmentedControl_before_dark SegmentedControl_after_dark
SegmentedControl_before_color SegmentedControl_after_color
SegmentedControl_rtl_before SegmentedControl_rtl_after
SegmentedControl_after_themes

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

New token system says we should use override tokens, not individual custom colors
The organization in this file is a bit of a mess, so I'll just put the new code in roughly the right spot and we can come back and reorder the rest of the file some other time.
… new class

The previous implementation would load blue when first launching the Segmented Control demo even if the theme was set to green because the window wasn't ready in viewDidLoad.
@huwilkes huwilkes requested a review from a team as a code owner March 9, 2022 00:31
@huwilkes huwilkes added the fluent2-tokens Changes meant to be merged to the fluent2-tokens branch. label Mar 9, 2022
@harrieshin
Copy link
Contributor

Screen Shot 2022-03-08 at 8 10 08 PM
what is this weird line in the segmented control in your gif?

@harrieshin
Copy link
Contributor

tested RTL?

@huwilkes
Copy link
Collaborator Author

huwilkes commented Mar 9, 2022

Screen Shot 2022-03-08 at 8 10 08 PM what is this weird line in the segmented control in your gif?

I'm not sure, but it was there before my changes. It doesn't really show up in the view hierarchy, and it goes away if you scroll at all. Could just be a simulator rendering issue? I can check an actual device.

@harrieshin
Copy link
Contributor

Screen Shot 2022-03-08 at 8 10 08 PM what is this weird line in the segmented control in your gif?

I'm not sure, but it was there before my changes. It doesn't really show up in the view hierarchy, and it goes away if you scroll at all. Could just be a simulator rendering issue? I can check an actual device.

that's concerning. try simulator slow animation? something is not calculated right?

@huwilkes huwilkes merged commit 3093481 into microsoft:vnext-tokens Mar 11, 2022
@huwilkes huwilkes deleted the huwilkes-segmentedControlTokenization branch July 15, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fluent2-tokens Changes meant to be merged to the fluent2-tokens branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants