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

Updating Segmented Control #449

Merged
merged 8 commits into from
Mar 2, 2021
Merged

Updating Segmented Control #449

merged 8 commits into from
Mar 2, 2021

Conversation

huwilkes
Copy link
Collaborator

@huwilkes huwilkes commented Feb 25, 2021

Platforms Impacted

  • iOS
  • macOS

Description of changes

Updating Segmented Control to add support for having full screen equal width pill buttons, customizable colors with pill buttons, the primary and onBrand styles for pill buttons, and the ability to retrieve the view of a button at an index. Also updated the demo app to show the new styles with and without equal width

Verification

Before After
Before segmented control update iPhone Light After segmented control update iPhone Light
Before segmented control update iPhone Dark After segmented control update iPhone Dark
Before segmented control update iPad After segmented control update iPad

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • 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)
Microsoft Reviewers: Open in CodeFlow

Updating Segmented Control to add support for having full screen equal width pill buttons, customizable colors with pill buttons, the primary and onBrand styles for pill buttons, and the ability to retrieve the view of a button at an index
@huwilkes huwilkes requested a review from a team as a code owner February 25, 2021 19:32
Simplified Switch Case statements by combining similar cases. Removed Calls to #available api. Removed unnecessary call to set cornerCurve on pill button.
@harrieshin
Copy link
Contributor

can you also add darkmode images and ipad images in the description of the PR? you can use markdown for table to make it look more organized with screenshots

ios/FluentUI/Controls/SegmentedControl.swift Outdated Show resolved Hide resolved
ios/FluentUI/Controls/SegmentedControl.swift Show resolved Hide resolved
ios/FluentUI/Controls/SegmentedControl.swift Outdated Show resolved Hide resolved
ios/FluentUI/Controls/SegmentedControl.swift Outdated Show resolved Hide resolved
ios/FluentUI/Controls/SegmentedControl.swift Outdated Show resolved Hide resolved
ios/FluentUI/Controls/SegmentedControl.swift Outdated Show resolved Hide resolved
ios/FluentUI/Controls/SegmentedControl.swift Outdated Show resolved Hide resolved
ios/FluentUI/Controls/SegmentedControl.swift Outdated Show resolved Hide resolved
ios/FluentUI/Controls/SegmentedControl.swift Outdated Show resolved Hide resolved
Fixed some code style concerns along with making changes to the demo app to better present the controls on the proper background. Also fixed a safe area issue on nothced iPhones.
Some how dropped the changes I meant to commit last time. They're in this commit, along with changes to try and use the UIWindowScene screen
Update struct properties to no longer be public
Updated the demo app to center the equal width controls. Changed the name of getViewForButton(at index:) to segmentView(at index:)
Copy link
Contributor

@rdeassis rdeassis left a comment

Choose a reason for hiding this comment

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

I just found a constraint issue on the trailing button with the background.

Other than that and the pod lib lint failure, it's looking good!

ios/FluentUI/Controls/SegmentedControl.swift Show resolved Hide resolved
Fixed a broken layout constraint on the width/trailing constraints of the control and updated the subspecs to move segmented control to its own subspec that depends on pill button. Also moved the segmented control's source file to its own folder to properly remove it from the controls subspec.
@huwilkes huwilkes requested a review from a team as a code owner March 2, 2021 05:39
The static lib build was failing in the date time picker because SegmentedControl.swift wasn't included in the FluentUILib target. Also removed an extra SegmentedControl.swift from the top of the project that didn't belong.
@huwilkes huwilkes merged commit b17f65b into microsoft:main Mar 2, 2021
@huwilkes huwilkes deleted the SegmentedControlUpdate1 branch March 2, 2021 20:13
@@ -87,6 +88,13 @@ Pod::Spec.new do |s|
presenters_ios.dependency 'MicrosoftFluentUI/Controls_ios'
presenters_ios.source_files = ["ios/FluentUI/Presenters/**/*.{swift,h}"]
end

s.subspec 'SegmentedControl_ios' do |segmentedcontrol_ios|
segmentedcontrol_ios.platform = :ios
Copy link
Contributor

Choose a reason for hiding this comment

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

@huwilkes can you fix the indentation here? We only use spaces instead of tabs.

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