Skip to content

Commit

Permalink
Merge pull request #1731 from amgleitman/navbar-merge-main-2023-05-04…
Browse files Browse the repository at this point in the history
…-minus-1699

Merge NavBar feature branch into main
  • Loading branch information
amgleitman authored May 15, 2023
2 parents 8f3eb7d + ce42eb2 commit a447e28
Show file tree
Hide file tree
Showing 54 changed files with 1,750 additions and 500 deletions.
4 changes: 4 additions & 0 deletions ios/FluentUI.Demo/FluentUI.Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
532FE3DC26EA6D8D007539C0 /* ActivityIndicatorDemoController_SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 532FE3DA26EA6D8D007539C0 /* ActivityIndicatorDemoController_SwiftUI.swift */; };
5336B17D27F7817300B01E0D /* HUDDemoController_SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5336B17B27F7817300B01E0D /* HUDDemoController_SwiftUI.swift */; };
5373D55F2694C3070032A3B4 /* AvatarDemoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5373D55E2694C3070032A3B4 /* AvatarDemoController.swift */; };
66963D0C29CB792E006F5FA9 /* TwoLineTitleViewDemoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66963D0B29CB792E006F5FA9 /* TwoLineTitleViewDemoController.swift */; };
6F453CA528AC536300ED91A4 /* ShadowTokensDemoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F453CA428AC536300ED91A4 /* ShadowTokensDemoController.swift */; };
6FC8AD3B28DBAF280010C0F8 /* ReadmeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FC8AD3A28DBAF280010C0F8 /* ReadmeViewController.swift */; };
6FEED93B28A6E5520099D178 /* AliasColorTokensDemoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FEED93A28A6E5520099D178 /* AliasColorTokensDemoController.swift */; };
Expand Down Expand Up @@ -206,6 +207,7 @@
5373D55E2694C3070032A3B4 /* AvatarDemoController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AvatarDemoController.swift; sourceTree = "<group>"; };
5373F95426F28D3A007F1410 /* IndeterminateProgressBarDemoController_SwiftUI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndeterminateProgressBarDemoController_SwiftUI.swift; sourceTree = "<group>"; };
5373F95626F28D9B007F1410 /* IndeterminateProgressBarDemoController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndeterminateProgressBarDemoController.swift; sourceTree = "<group>"; };
66963D0B29CB792E006F5FA9 /* TwoLineTitleViewDemoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwoLineTitleViewDemoController.swift; sourceTree = "<group>"; };
6F453CA428AC536300ED91A4 /* ShadowTokensDemoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShadowTokensDemoController.swift; sourceTree = "<group>"; };
6FC8AD3A28DBAF280010C0F8 /* ReadmeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadmeViewController.swift; sourceTree = "<group>"; };
6FEED93A28A6E5520099D178 /* AliasColorTokensDemoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AliasColorTokensDemoController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -544,6 +546,7 @@
EC98E2B72992FE6900B9DF91 /* TextFieldObjCDemoController.h */,
EC98E2B52992FE5000B9DF91 /* TextFieldObjCDemoController.m */,
FD7DF06121FB941400857267 /* TooltipDemoController.swift */,
66963D0B29CB792E006F5FA9 /* TwoLineTitleViewDemoController.swift */,
92D5FDFC28AC57650087894B /* TypographyTokensDemoController.swift */,
6FEED93A28A6E5520099D178 /* AliasColorTokensDemoController.swift */,
6F453CA428AC536300ED91A4 /* ShadowTokensDemoController.swift */,
Expand Down Expand Up @@ -797,6 +800,7 @@
5336B17D27F7817300B01E0D /* HUDDemoController_SwiftUI.swift in Sources */,
92561E732718AD090072ED00 /* DemoTableViewController.swift in Sources */,
43488C4A270FB7E800124C71 /* NotificationViewDemoController_SwiftUI.swift in Sources */,
66963D0C29CB792E006F5FA9 /* TwoLineTitleViewDemoController.swift in Sources */,
497DC2DE24185896008D86F8 /* PillButtonBarDemoController.swift in Sources */,
B4EF53C5215C45C400573E8F /* PersonaListViewDemoController.swift in Sources */,
A5DCA75E211E3A92005F4CB7 /* DrawerDemoController.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class ColoredPillBackgroundView: UIView {
func updateBackgroundColor() {
switch style {
case .neutralNavBar:
backgroundColor = NavigationBar.Style.system.backgroundColor(fluentTheme: fluentTheme)
backgroundColor = NavigationBar.backgroundColor(for: .system, theme: fluentTheme)
case .brandNavBar:
backgroundColor = NavigationBar.Style.primary.backgroundColor(fluentTheme: fluentTheme)
backgroundColor = NavigationBar.backgroundColor(for: .primary, theme: fluentTheme)
case .canvas:
backgroundColor = fluentTheme.color(.backgroundCanvas)
}
Expand Down
2 changes: 1 addition & 1 deletion ios/FluentUI.Demo/FluentUI.Demo/DemoController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class DemoController: UIViewController {
style: .plain,
target: self,
action: #selector(showAppearancePopover(_:)))
let readmeButton = UIBarButtonItem(image: UIImage(systemName: "i.circle.fill"),
let readmeButton = UIBarButtonItem(image: UIImage(systemName: "info.circle.fill"),
style: .plain,
target: self,
action: #selector(showReadmePopover))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DemoTableViewController: UITableViewController {
style: .plain,
target: self,
action: #selector(showAppearancePopover))
let readmeButton = UIBarButtonItem(image: UIImage(systemName: "i.circle.fill"),
let readmeButton = UIBarButtonItem(image: UIImage(systemName: "info.circle.fill"),
style: .plain,
target: self,
action: #selector(showReadmePopover))
Expand Down
5 changes: 3 additions & 2 deletions ios/FluentUI.Demo/FluentUI.Demo/Demos.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct Demos {
DemoDescriptor("IndeterminateProgressBar", IndeterminateProgressBarDemoController.self),
DemoDescriptor("Label", LabelDemoController.self),
DemoDescriptor("MultilineCommandBar", MultilineCommandBarDemoController.self),
DemoDescriptor("NavigationController", NavigationControllerDemoController.self),
DemoDescriptor("NotificationView", NotificationViewDemoController.self),
DemoDescriptor("Other cells", OtherCellsDemoController.self),
DemoDescriptor("PersonaButtonCarousel", PersonaButtonCarouselDemoController.self),
Expand All @@ -46,7 +47,8 @@ struct Demos {
DemoDescriptor("TableViewCell", TableViewCellDemoController.self),
DemoDescriptor("TableViewHeaderFooterView", TableViewHeaderFooterViewDemoController.self),
DemoDescriptor("Text Field", TextFieldDemoController.self),
DemoDescriptor("Tooltip", TooltipDemoController.self)
DemoDescriptor("Tooltip", TooltipDemoController.self),
DemoDescriptor("TwoLineTitleView", TwoLineTitleViewDemoController.self)
]

static let fluent2DesignTokens: [DemoDescriptor] = [
Expand All @@ -61,7 +63,6 @@ struct Demos {
DemoDescriptor("BottomCommandingController", BottomCommandingDemoController.self),
DemoDescriptor("Card", CardViewDemoController.self),
DemoDescriptor("DateTimePicker", DateTimePickerDemoController.self),
DemoDescriptor("NavigationController", NavigationControllerDemoController.self),
DemoDescriptor("PeoplePicker", PeoplePickerDemoController.self),
DemoDescriptor("PersonaListView", PersonaListViewDemoController.self),
DemoDescriptor("TableViewCellFileAccessoryView", TableViewCellFileAccessoryViewDemoController.self),
Expand Down
18 changes: 18 additions & 0 deletions ios/FluentUI.Demo/FluentUI.Demo/Demos/LabelDemoController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ class LabelDemoController: DemoController {
textColorLabels.append(addLabel(text: colorStyle.description, style: .body1, colorStyle: colorStyle))
}

addLabel(text: "Text Color Custom Styles", style: .body1Strong, colorStyle: .regular).textAlignment = .center

let dangerSuccessLabel = Label(textStyle: .body1Strong, colorForTheme: {
theme in
UIColor(light: theme.color(.dangerForeground1), dark: theme.color(.successBackground2))
})
dangerSuccessLabel.text = "Danger/Success"
container.addArrangedSubview(dangerSuccessLabel)
textColorLabels.append(dangerSuccessLabel)

let blueYellowLabel = Label(textStyle: .body1Strong, colorForTheme: {
_ in
UIColor(light: GlobalTokens.sharedColor(.blue, .primary), dark: GlobalTokens.sharedColor(.yellow, .primary))
})
blueYellowLabel.text = "Blue/Yellow"
container.addArrangedSubview(blueYellowLabel)
textColorLabels.append(blueYellowLabel)

container.addArrangedSubview(UIView()) // spacer

NotificationCenter.default.addObserver(self, selector: #selector(handleContentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
Expand Down
Loading

0 comments on commit a447e28

Please sign in to comment.