From 527ae28ece905cf357b799ab9c8ef3985ff32384 Mon Sep 17 00:00:00 2001 From: Patrick Latter Date: Wed, 5 Feb 2025 16:09:54 -0800 Subject: [PATCH 1/7] Fluent update --- AzureCommunicationUI/Podfile | 36 +++++++------- AzureCommunicationUI/Podfile.lock | 47 ++++++++++--------- .../Style/ColorThemeProvider.swift | 39 ++++++++++----- 3 files changed, 69 insertions(+), 53 deletions(-) diff --git a/AzureCommunicationUI/Podfile b/AzureCommunicationUI/Podfile index 07a03b70d..a1e711ebd 100644 --- a/AzureCommunicationUI/Podfile +++ b/AzureCommunicationUI/Podfile @@ -13,12 +13,12 @@ target 'AzureCommunicationUICalling' do use_frameworks! pod 'AzureCore', '1.0.0-beta.15' pod 'AzureCommunicationCalling', '2.14.1' - pod 'MicrosoftFluentUI/Avatar_ios', '0.10.0' - pod 'MicrosoftFluentUI/BottomSheet_ios', '0.10.0' - pod 'MicrosoftFluentUI/Button_ios', '0.10.0' - pod 'MicrosoftFluentUI/PopupMenu_ios', '0.10.0' - pod 'MicrosoftFluentUI/ActivityIndicator_ios', '0.10.0' - pod 'MicrosoftFluentUI/AvatarGroup_ios', '0.10.0' + pod 'MicrosoftFluentUI/Avatar_ios', '0.32.0' + pod 'MicrosoftFluentUI/BottomSheet_ios', '0.32.0' + pod 'MicrosoftFluentUI/Button_ios', '0.32.0' + pod 'MicrosoftFluentUI/PopupMenu_ios', '0.32.0' + pod 'MicrosoftFluentUI/ActivityIndicator_ios', '0.32.0' + pod 'MicrosoftFluentUI/AvatarGroup_ios', '0.32.0' pod 'AzureCore', '1.0.0-beta.15' pod 'SwiftLint', '0.53.0' @@ -32,12 +32,12 @@ target 'AzureCommunicationUIChat' do project 'sdk/AzureCommunicationUIChat/AzureCommunicationUIChat.xcodeproj' use_frameworks! pod 'AzureCommunicationChat', '1.3.3' - pod 'MicrosoftFluentUI/Avatar_ios', '0.10.0' - pod 'MicrosoftFluentUI/BottomSheet_ios', '0.10.0' - pod 'MicrosoftFluentUI/Button_ios', '0.10.0' - pod 'MicrosoftFluentUI/PopupMenu_ios', '0.10.0' - pod 'MicrosoftFluentUI/ActivityIndicator_ios', '0.10.0' - pod 'MicrosoftFluentUI/AvatarGroup_ios', '0.10.0' + pod 'MicrosoftFluentUI/Avatar_ios', '0.32.0' + pod 'MicrosoftFluentUI/BottomSheet_ios', '0.32.0' + pod 'MicrosoftFluentUI/Button_ios', '0.32.0' + pod 'MicrosoftFluentUI/PopupMenu_ios', '0.32.0' + pod 'MicrosoftFluentUI/ActivityIndicator_ios', '0.32.0' + pod 'MicrosoftFluentUI/AvatarGroup_ios', '0.32.0' pod 'SwiftLint', '0.53.0' target 'AzureCommunicationUIChatTests' do @@ -51,12 +51,12 @@ target 'AzureCommunicationUIDemoApp' do use_frameworks! pod 'AzureCommunicationCalling', '2.14.1' pod 'AzureCommunicationChat', '1.3.3' - pod 'MicrosoftFluentUI/Avatar_ios', '0.10.0' - pod 'MicrosoftFluentUI/BottomSheet_ios', '0.10.0' - pod 'MicrosoftFluentUI/Button_ios', '0.10.0' - pod 'MicrosoftFluentUI/PopupMenu_ios', '0.10.0' - pod 'MicrosoftFluentUI/ActivityIndicator_ios', '0.10.0' - pod 'MicrosoftFluentUI/AvatarGroup_ios', '0.10.0' + pod 'MicrosoftFluentUI/Avatar_ios', '0.32.0' + pod 'MicrosoftFluentUI/BottomSheet_ios', '0.32.0' + pod 'MicrosoftFluentUI/Button_ios', '0.32.0' + pod 'MicrosoftFluentUI/PopupMenu_ios', '0.32.0' + pod 'MicrosoftFluentUI/ActivityIndicator_ios', '0.32.0' + pod 'MicrosoftFluentUI/AvatarGroup_ios', '0.32.0' pod 'SwiftLint', '0.53.0' pod 'AppCenter/Crashes', '4.4.1' diff --git a/AzureCommunicationUI/Podfile.lock b/AzureCommunicationUI/Podfile.lock index 9f705ff81..390f97151 100644 --- a/AzureCommunicationUI/Podfile.lock +++ b/AzureCommunicationUI/Podfile.lock @@ -10,40 +10,43 @@ PODS: - Trouter (= 0.2.0) - AzureCommunicationCommon (1.2.0) - AzureCore (1.0.0-beta.15) - - MicrosoftFluentUI/ActivityIndicator_ios (0.10.0): + - MicrosoftFluentUI/ActivityIndicator_ios (0.32.0): - MicrosoftFluentUI/Core_ios - - MicrosoftFluentUI/Avatar_ios (0.10.0): + - MicrosoftFluentUI/Avatar_ios (0.32.0): - MicrosoftFluentUI/Core_ios - - MicrosoftFluentUI/AvatarGroup_ios (0.10.0): + - MicrosoftFluentUI/AvatarGroup_ios (0.32.0): - MicrosoftFluentUI/Avatar_ios - - MicrosoftFluentUI/BottomSheet_ios (0.10.0): + - MicrosoftFluentUI/BottomSheet_ios (0.32.0): - MicrosoftFluentUI/Obscurable_ios - MicrosoftFluentUI/ResizingHandleView_ios - - MicrosoftFluentUI/Button_ios (0.10.0): + - MicrosoftFluentUI/Button_ios (0.32.0): - MicrosoftFluentUI/Core_ios - - MicrosoftFluentUI/Core_ios (0.10.0) - - MicrosoftFluentUI/Drawer_ios (0.10.0): + - MicrosoftFluentUI/Core_ios (0.32.0) + - MicrosoftFluentUI/Drawer_ios (0.32.0): - MicrosoftFluentUI/Obscurable_ios - MicrosoftFluentUI/ResizingHandleView_ios - MicrosoftFluentUI/Separator_ios - MicrosoftFluentUI/TouchForwardingView_ios - - MicrosoftFluentUI/Label_ios (0.10.0): + - MicrosoftFluentUI/Label_ios (0.32.0): - MicrosoftFluentUI/Core_ios - - MicrosoftFluentUI/Obscurable_ios (0.10.0): + - MicrosoftFluentUI/Obscurable_ios (0.32.0): - MicrosoftFluentUI/Core_ios - - MicrosoftFluentUI/PopupMenu_ios (0.10.0): + - MicrosoftFluentUI/PopupMenu_ios (0.32.0): - MicrosoftFluentUI/Drawer_ios - MicrosoftFluentUI/Label_ios - MicrosoftFluentUI/Separator_ios - MicrosoftFluentUI/TableView_ios - - MicrosoftFluentUI/ResizingHandleView_ios (0.10.0): + - MicrosoftFluentUI/ResizingHandleView_ios (0.32.0): - MicrosoftFluentUI/Core_ios - - MicrosoftFluentUI/Separator_ios (0.10.0): + - MicrosoftFluentUI/Separator_ios (0.32.0): - MicrosoftFluentUI/Core_ios - - MicrosoftFluentUI/TableView_ios (0.10.0): + - MicrosoftFluentUI/TableView_ios (0.32.0): - MicrosoftFluentUI/Label_ios - MicrosoftFluentUI/Separator_ios - - MicrosoftFluentUI/TouchForwardingView_ios (0.10.0): + - MicrosoftFluentUI/TableViewListShared_ios + - MicrosoftFluentUI/TableViewListShared_ios (0.32.0): + - MicrosoftFluentUI/Core_ios + - MicrosoftFluentUI/TouchForwardingView_ios (0.32.0): - MicrosoftFluentUI/Core_ios - SwiftLint (0.53.0) - Trouter (0.2.0) @@ -53,12 +56,12 @@ DEPENDENCIES: - AzureCommunicationCalling (= 2.14.1) - AzureCommunicationChat (= 1.3.3) - AzureCore (= 1.0.0-beta.15) - - MicrosoftFluentUI/ActivityIndicator_ios (= 0.10.0) - - MicrosoftFluentUI/Avatar_ios (= 0.10.0) - - MicrosoftFluentUI/AvatarGroup_ios (= 0.10.0) - - MicrosoftFluentUI/BottomSheet_ios (= 0.10.0) - - MicrosoftFluentUI/Button_ios (= 0.10.0) - - MicrosoftFluentUI/PopupMenu_ios (= 0.10.0) + - MicrosoftFluentUI/ActivityIndicator_ios (= 0.32.0) + - MicrosoftFluentUI/Avatar_ios (= 0.32.0) + - MicrosoftFluentUI/AvatarGroup_ios (= 0.32.0) + - MicrosoftFluentUI/BottomSheet_ios (= 0.32.0) + - MicrosoftFluentUI/Button_ios (= 0.32.0) + - MicrosoftFluentUI/PopupMenu_ios (= 0.32.0) - SwiftLint (= 0.53.0) SPEC REPOS: @@ -78,10 +81,10 @@ SPEC CHECKSUMS: AzureCommunicationChat: 79fb67f0d6160754817d77d307565a015a5eb9b2 AzureCommunicationCommon: 130a21be2be889f83dc4adbf994af6285f962de8 AzureCore: ebbf7cf4dfe72afc7584088c38d1c99f5a35d647 - MicrosoftFluentUI: f6db695718efb93f4ca9bdc366c00b80a1f91dba + MicrosoftFluentUI: d6ea08c5237e92694a0976a978971b8f13ff8251 SwiftLint: 5ce4d6a8ff83f1b5fd5ad5dbf30965d35af65e44 Trouter: 7eab36954ad740e32db3ff9f6025b0dff92193d7 -PODFILE CHECKSUM: 71492c39a100fcfefef00ad5c62a3e055f4b63a8 +PODFILE CHECKSUM: b06e1c305d40b2ac9207fb053dc519d636b84035 COCOAPODS: 1.16.2 diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift index 3a303fa4e..05372c056 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift @@ -6,8 +6,11 @@ import Foundation import FluentUI import UIKit +import SwiftUICore class ColorThemeProvider { + @Environment(\.fluentTheme) private var fluentTheme: FluentTheme + let colorSchemeOverride: UIUserInterfaceStyle let primaryColor: UIColor @@ -15,24 +18,34 @@ class ColorThemeProvider { let primaryColorTint20: UIColor let primaryColorTint30: UIColor - let textDominant: UIColor = Colors.textDominant - let textPrimary: UIColor = Colors.textPrimary - let textSecondary: UIColor = Colors.textSecondary - let textDisabled: UIColor = Colors.textDisabled - let surfaceTertiary: UIColor = Colors.surfaceTertiary - let dividerOnPrimary: UIColor = Colors.dividerOnPrimary - let iconSecondary: UIColor = Colors.iconSecondary - let iconDisabled: UIColor = Colors.iconDisabled + let textDominant: UIColor // = Colors.textDominant + let textPrimary: UIColor // = Colors.textPrimary + let textSecondary: UIColor // = Colors.textSecondary + let textDisabled: UIColor // = Colors.textDisabled + let surfaceTertiary: UIColor // = Colors.surfaceTertiary + let dividerOnPrimary: UIColor // = Colors.dividerOnPrimary + let iconSecondary: UIColor // = Colors.iconSecondary + let iconDisabled: UIColor // = Colors.iconDisabled - let dangerPrimary: UIColor = Colors.error + let dangerPrimary: UIColor // = Colors.error init(themeOptions: ThemeOptions?) { self.colorSchemeOverride = themeOptions?.colorSchemeOverride ?? .unspecified - self.primaryColor = themeOptions?.primaryColor ?? Colors.Palette.communicationBlue.color - self.primaryColorTint10 = themeOptions?.primaryColorTint10 ?? Colors.Palette.communicationBlueTint10.color - self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? Colors.Palette.communicationBlueTint20.color - self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? Colors.Palette.communicationBlueTint30.color + + self.primaryColor = themeOptions?.primaryColor ?? fluentTheme.color(.foreground1) // Colors.Palette.communicationBlue.color + self.primaryColorTint10 = themeOptions?.primaryColorTint10 ?? fluentTheme.color(.foreground1) // Colors.Palette.communicationBlueTint10.color + self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? fluentTheme.color(.foreground1) // Colors.Palette.communicationBlueTint20.color + self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? fluentTheme.color(.foreground1) // Colors.Palette.communicationBlueTint30.color + + self.textDominant = fluentTheme.color(.foreground1) + self.textPrimary = fluentTheme.color(.foreground1) + self.textSecondary = fluentTheme.color(.foreground1) + self.textDisabled = fluentTheme.color(.foreground1) + self.surfaceTertiary = fluentTheme.color(.foreground1) + self.dividerOnPrimary = fluentTheme.color(.foreground1) + self.iconDisabled = fluentTheme.color(.foreground1) + self.dangerPrimary = fluentTheme.color(.foreground1) } private func dynamicColor(light: UIColor, dark: UIColor) -> UIColor { From 97de35e690cd4647386b57fb5b584e5db829147c Mon Sep 17 00:00:00 2001 From: Patrick Latter Date: Fri, 7 Feb 2025 11:20:11 -0800 Subject: [PATCH 2/7] Update colorProvider --- .../Style/ColorThemeProvider.swift | 159 ++++++++++++------ 1 file changed, 105 insertions(+), 54 deletions(-) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift index 05372c056..046076023 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift @@ -9,43 +9,40 @@ import UIKit import SwiftUICore class ColorThemeProvider { - @Environment(\.fluentTheme) private var fluentTheme: FluentTheme - + let fluentTheme = FluentTheme() let colorSchemeOverride: UIUserInterfaceStyle - let primaryColor: UIColor - let primaryColorTint10: UIColor - let primaryColorTint20: UIColor - let primaryColorTint30: UIColor - - let textDominant: UIColor // = Colors.textDominant - let textPrimary: UIColor // = Colors.textPrimary - let textSecondary: UIColor // = Colors.textSecondary - let textDisabled: UIColor // = Colors.textDisabled - let surfaceTertiary: UIColor // = Colors.surfaceTertiary - let dividerOnPrimary: UIColor // = Colors.dividerOnPrimary - let iconSecondary: UIColor // = Colors.iconSecondary - let iconDisabled: UIColor // = Colors.iconDisabled - - let dangerPrimary: UIColor // = Colors.error +// let primaryColor: UIColor +// let primaryColorTint10: UIColor +// let primaryColorTint20: UIColor +// let primaryColorTint30: UIColor + +// let textDominant: UIColor = Colors.textDominant +// let textPrimary: UIColor = Colors.textPrimary +// let textSecondary: UIColor = Colors.textSecondary +// let textDisabled: UIColor = Colors.textDisabled +// let surfaceTertiary: UIColor = Colors.surfaceTertiary +// let dividerOnPrimary: UIColor = Colors.dividerOnPrimary +// let iconSecondary: UIColor = Colors.iconSecondary +// let iconDisabled: UIColor = Colors.iconDisabled\ +// let dangerPrimary: UIColor // = Colors.error init(themeOptions: ThemeOptions?) { self.colorSchemeOverride = themeOptions?.colorSchemeOverride ?? .unspecified - - self.primaryColor = themeOptions?.primaryColor ?? fluentTheme.color(.foreground1) // Colors.Palette.communicationBlue.color - self.primaryColorTint10 = themeOptions?.primaryColorTint10 ?? fluentTheme.color(.foreground1) // Colors.Palette.communicationBlueTint10.color - self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? fluentTheme.color(.foreground1) // Colors.Palette.communicationBlueTint20.color - self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? fluentTheme.color(.foreground1) // Colors.Palette.communicationBlueTint30.color - - self.textDominant = fluentTheme.color(.foreground1) - self.textPrimary = fluentTheme.color(.foreground1) - self.textSecondary = fluentTheme.color(.foreground1) - self.textDisabled = fluentTheme.color(.foreground1) - self.surfaceTertiary = fluentTheme.color(.foreground1) - self.dividerOnPrimary = fluentTheme.color(.foreground1) - self.iconDisabled = fluentTheme.color(.foreground1) - self.dangerPrimary = fluentTheme.color(.foreground1) +// self.primaryColor = themeOptions?.primaryColor ?? Colors.Palette.communicationBlue.color +// self.primaryColorTint10 = themeOptions?.primaryColorTint10 ?? Colors.Palette.communicationBlueTint10.color +// self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? Colors.Palette.communicationBlueTint20.color +// self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? Colors.Palette.communicationBlueTint30.color + +// self.textDominant = fluentTheme.color(.foreground1) +// self.textPrimary = fluentTheme.color(.foreground1) +// self.textSecondary = fluentTheme.color(.foreground1) +// self.textDisabled = fluentTheme.color(.foreground1) +// self.surfaceTertiary = fluentTheme.color(.foreground1) +// self.dividerOnPrimary = fluentTheme.color(.foreground1) +// self.iconDisabled = fluentTheme.color(.foreground1) +// self.dangerPrimary = fluentTheme.color(.foreground1) } private func dynamicColor(light: UIColor, dark: UIColor) -> UIColor { @@ -54,35 +51,89 @@ class ColorThemeProvider { } extension ColorThemeProvider: ColorProviding { - func primaryColor(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackground1: UIColor { + return fluentTheme.color(.brandBackground1) } - - func primaryTint10Color(for window: UIWindow) -> UIColor? { - return primaryColorTint10 + var brandBackground1Pressed: UIColor { + return fluentTheme.color(.brandBackground1Pressed) } - - func primaryTint20Color(for window: UIWindow) -> UIColor? { - return primaryColorTint20 + var brandBackground1Selected: UIColor { + return fluentTheme.color(.brandBackground1Selected) } - - func primaryTint30Color(for window: UIWindow) -> UIColor? { - return primaryColorTint30 + var brandBackground2: UIColor { + return fluentTheme.color(.brandBackground2) } - - func primaryTint40Color(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackground2Pressed: UIColor { + return fluentTheme.color(.brandBackground2Pressed) } - - func primaryShade10Color(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackground2Selected: UIColor { + return fluentTheme.color(.brandBackground2Selected) } - - func primaryShade20Color(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackground3: UIColor { + return fluentTheme.color(.background3) } - - func primaryShade30Color(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackgroundTint: UIColor { + return fluentTheme.color(.brandBackgroundTint) + } + var brandBackgroundDisabled: UIColor { + return fluentTheme.color(.brandBackgroundDisabled) + } + var brandForeground1: UIColor { + return fluentTheme.color(.brandForeground1) + } + var brandForeground1Pressed: UIColor { + return fluentTheme.color(.brandForeground1Pressed) + } + var brandForeground1Selected: UIColor { + return fluentTheme.color(.brandForeground1Selected) } + var brandForegroundTint: UIColor { + return fluentTheme.color(.brandForegroundTint) + } + var brandForegroundDisabled1: UIColor { + return fluentTheme.color(.brandForegroundDisabled1) + } + var brandForegroundDisabled2: UIColor { + return fluentTheme.color(.brandForegroundDisabled2) + } + var brandStroke1: UIColor { + return fluentTheme.color(.brandStroke1) + } + var brandStroke1Pressed: UIColor { + return fluentTheme.color(.brandStroke1Pressed) + } + var brandStroke1Selected: UIColor { + return fluentTheme.color(.brandStroke1Selected) + } +// func primaryColor(for window: UIWindow) -> UIColor? { +// return primaryColor +// } +// +// func primaryTint10Color(for window: UIWindow) -> UIColor? { +// return primaryColorTint10 +// } +// +// func primaryTint20Color(for window: UIWindow) -> UIColor? { +// return primaryColorTint20 +// } +// +// func primaryTint30Color(for window: UIWindow) -> UIColor? { +// return primaryColorTint30 +// } +// +// func primaryTint40Color(for window: UIWindow) -> UIColor? { +// return primaryColor +// } +// +// func primaryShade10Color(for window: UIWindow) -> UIColor? { +// return primaryColor +// } +// +// func primaryShade20Color(for window: UIWindow) -> UIColor? { +// return primaryColor +// } +// +// func primaryShade30Color(for window: UIWindow) -> UIColor? { +// return primaryColor +// } } From 5a70f403c22b5ff05d1c91ab157821c05e43faf6 Mon Sep 17 00:00:00 2001 From: Patrick Latter Date: Fri, 7 Feb 2025 14:42:56 -0800 Subject: [PATCH 3/7] Update Chat --- .../ChatCompositeOptions/ThemeOptions.swift | 34 +++++++++---------- .../Style/ColorThemeProvider.swift | 21 +++++++----- .../SwiftUI/Button/IconButton.swift | 6 ++-- .../ChatViewComponents/BottomBarView.swift | 6 ++-- .../Message/HtmlMessageView.swift | 2 +- .../Message/MessageView.swift | 2 +- .../Message/SystemMessageView.swift | 4 +-- .../Message/TextMessageView.swift | 12 +++---- .../ChatViewComponents/MessageListView.swift | 6 ++-- .../Chat/ChatViewComponents/TopBarView.swift | 2 +- 10 files changed, 50 insertions(+), 45 deletions(-) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/ChatCompositeOptions/ThemeOptions.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/ChatCompositeOptions/ThemeOptions.swift index c74750d33..5631a92f3 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/ChatCompositeOptions/ThemeOptions.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/ChatCompositeOptions/ThemeOptions.swift @@ -31,20 +31,20 @@ protocol ThemeOptions { var primaryColorTint30: UIColor { get } } -extension ThemeOptions { - var colorSchemeOverride: UIUserInterfaceStyle { - return .unspecified - } - var primaryColor: UIColor { - return Colors.Palette.communicationBlue.color - } - var primaryColorTint10: UIColor { - return Colors.Palette.communicationBlueTint10.color - } - var primaryColorTint20: UIColor { - return Colors.Palette.communicationBlueTint20.color - } - var primaryColorTint30: UIColor { - return Colors.Palette.communicationBlueTint30.color - } -} +// extension ThemeOptions { +// var colorSchemeOverride: UIUserInterfaceStyle { +// return .unspecified +// } +// var primaryColor: UIColor { +// return Colors.Palette.communicationBlue.color +// } +// var primaryColorTint10: UIColor { +// return Colors.Palette.communicationBlueTint10.color +// } +// var primaryColorTint20: UIColor { +// return Colors.Palette.communicationBlueTint20.color +// } +// var primaryColorTint30: UIColor { +// return Colors.Palette.communicationBlueTint30.color +// } +// } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift index 046076023..7f48a82cb 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift @@ -27,6 +27,13 @@ class ColorThemeProvider { // let iconDisabled: UIColor = Colors.iconDisabled\ // let dangerPrimary: UIColor // = Colors.error + let foreground1: Color + let foreground2: Color + let foreground3: Color + let foregroundDisabled1: Color + let stroke2: Color + let severeBackground1: Color + init(themeOptions: ThemeOptions?) { self.colorSchemeOverride = themeOptions?.colorSchemeOverride ?? .unspecified @@ -35,14 +42,12 @@ class ColorThemeProvider { // self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? Colors.Palette.communicationBlueTint20.color // self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? Colors.Palette.communicationBlueTint30.color -// self.textDominant = fluentTheme.color(.foreground1) -// self.textPrimary = fluentTheme.color(.foreground1) -// self.textSecondary = fluentTheme.color(.foreground1) -// self.textDisabled = fluentTheme.color(.foreground1) -// self.surfaceTertiary = fluentTheme.color(.foreground1) -// self.dividerOnPrimary = fluentTheme.color(.foreground1) -// self.iconDisabled = fluentTheme.color(.foreground1) -// self.dangerPrimary = fluentTheme.color(.foreground1) + self.foreground1 = fluentTheme.swiftUIColor(.foreground1) // F1: textDominant + self.foreground2 = fluentTheme.swiftUIColor(.foreground2) // F1: textSecondary? + self.foreground3 = fluentTheme.swiftUIColor(.foreground3) // F1: iconSecondary? + self.foregroundDisabled1 = fluentTheme.swiftUIColor(.foregroundDisabled1) // F1: iconDisabled + self.stroke2 = fluentTheme.swiftUIColor(.stroke2) // F1: dividerOnPrimary + self.severeBackground1 = fluentTheme.swiftUIColor(.severeBackground1) // F1: dangerPrimary? } private func dynamicColor(light: UIColor, dark: UIColor) -> UIColor { diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Button/IconButton.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Button/IconButton.swift index b641040bb..b4b9129b7 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Button/IconButton.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Button/IconButton.swift @@ -40,9 +40,9 @@ extension IconButtonViewModel.ButtonType { var buttonForegroundColor: Color { switch self { case .controlButton: - return Color(StyleProvider.color.textDominant) + return StyleProvider.color.foregroundDisabled1 case .sendButton: - return Color(StyleProvider.color.primaryColor) + return Color(StyleProvider.color.brandBackground1) } } @@ -78,7 +78,7 @@ extension IconButtonViewModel.ButtonType { struct IconButton: View { @ObservedObject var viewModel: IconButtonViewModel - private let buttonDisabledColor = Color(StyleProvider.color.iconDisabled) + private let buttonDisabledColor = StyleProvider.color.foregroundDisabled1 var body: some View { let buttonType = viewModel.buttonType diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/BottomBarView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/BottomBarView.swift index 4960a889d..b920c2e5b 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/BottomBarView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/BottomBarView.swift @@ -38,7 +38,7 @@ struct BottomBarView: View { var localParticipantRemovedBanner: some View { Text("You're no longer a participant") - .foregroundColor(Color(StyleProvider.color.textSecondary)) + .foregroundColor(StyleProvider.color.foreground2) } } @@ -90,14 +90,14 @@ struct TextEditorView: View { .padding([.leading], Constants.leadingPadding) .padding([.top], Constants.padding) .overlay(RoundedRectangle(cornerRadius: Constants.cornerRadius) - .stroke(Color(StyleProvider.color.dividerOnPrimary))) + .stroke(StyleProvider.color.stroke2)) } var placeHolder: some View { Group { if text.isEmpty { Text("Type a message") // Localization - .foregroundColor(Color(StyleProvider.color.textDisabled)) + .foregroundColor(StyleProvider.color.foregroundDisabled1) .padding(Constants.placeHolderPadding) .allowsHitTesting(false) } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/HtmlMessageView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/HtmlMessageView.swift index 02c6c4676..22b019a03 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/HtmlMessageView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/HtmlMessageView.swift @@ -12,7 +12,7 @@ struct HtmlMessageView: View { HStack { Text(messageModel.getContentLabel()) .font(.caption2) - .foregroundColor(Color(StyleProvider.color.textSecondary)) + .foregroundColor(StyleProvider.color.foreground2) Spacer() } } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/MessageView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/MessageView.swift index 0c51f3d5c..24387383f 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/MessageView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/MessageView.swift @@ -44,7 +44,7 @@ struct MessageView: View { if showDateHeader { Text(messageModel.dateHeaderLabel) .font(.caption) - .foregroundColor(Color(StyleProvider.color.textSecondary)) + .foregroundColor(StyleProvider.color.foreground2) } } } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/SystemMessageView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/SystemMessageView.swift index 430ca27e4..310e77100 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/SystemMessageView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/SystemMessageView.swift @@ -27,14 +27,14 @@ struct SystemMessageView: View { var message: some View { Text(messageModel.systemLabel) .font(.caption2) - .foregroundColor(Color(StyleProvider.color.textSecondary)) + .foregroundColor(StyleProvider.color.foreground2) } var icon: some View { Group { if let icon = messageModel.systemIcon { Icon(name: icon, size: Constants.iconSize) - .foregroundColor(Color(StyleProvider.color.iconSecondary)) + .foregroundColor(StyleProvider.color.foreground3) } } } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift index 9e4a5d4b2..c443d37f0 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift @@ -67,7 +67,7 @@ struct TextMessageView: View { Text(messageModel.senderDisplayName!) .font(.caption) .fontWeight(.bold) - .foregroundColor(Color(StyleProvider.color.textPrimary)) + .foregroundColor(StyleProvider.color.foreground1) } } } @@ -77,7 +77,7 @@ struct TextMessageView: View { if showTime { Text(messageModel.timestamp) .font(.caption) - .foregroundColor(Color(StyleProvider.color.textSecondary)) + .foregroundColor(StyleProvider.color.foreground2) } } } @@ -87,7 +87,7 @@ struct TextMessageView: View { if messageModel.editedOn != nil { Text("Edited") .font(.caption) - .foregroundColor(Color(StyleProvider.color.textDisabled)) + .foregroundColor(StyleProvider.color.foregroundDisabled1) } } } @@ -106,13 +106,13 @@ struct TextMessageView: View { private func getMessageBubbleBackground(messageModel: ChatMessageInfoModel) -> Color { guard messageModel.isLocalUser else { - return Color(StyleProvider.color.surfaceTertiary) + return Color(StyleProvider.color.brandForeground1) // Needs to be lighter? } if messageModel.sendStatus == .failed { - return Color(StyleProvider.color.dangerPrimary).opacity(0.2) + return StyleProvider.color.severeBackground1 } else { - return Color(StyleProvider.color.primaryColorTint30) + return Color(StyleProvider.color.brandBackground1) // ? } } } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/MessageListView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/MessageListView.swift index 4196d8a4b..3798eb9b2 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/MessageListView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/MessageListView.swift @@ -136,7 +136,7 @@ struct MessageListView: View { } .padding() .foregroundColor(.white) - .background(Color(StyleProvider.color.primaryColor)) + .background(Color(StyleProvider.color.brandBackground1)) .clipShape(Capsule()) .shadow(radius: Constants.buttonShadowRadius, y: Constants.buttonShadowOffset) .padding(.bottom, Constants.buttonBottomPadding) @@ -170,7 +170,7 @@ struct MessageListView: View { private func createMessageSendStatus(message: ChatMessageInfoModel) -> some View { let shouldShowMessageStatusView = viewModel.shouldShowMessageStatusView(message: message) let tintColor = message.sendStatus == .failed - ? StyleProvider.color.dangerPrimary : StyleProvider.color.primaryColor + ? StyleProvider.color.severeBackground1 : Color(StyleProvider.color.brandBackground1) VStack { Spacer() if message.isLocalUser, @@ -180,7 +180,7 @@ struct MessageListView: View { StyleProvider.icon.getImage(for: iconName) .frame(width: Constants.messageSendStatusIconSize, height: Constants.messageSendStatusIconSize) - .foregroundColor(Color(tintColor)) + .foregroundColor(StyleProvider.color.foreground3) // ? .padding([.bottom, .trailing], Constants.messageSendStatusViewPadding) } } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/TopBarView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/TopBarView.swift index 22b2c8fe8..b82dee141 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/TopBarView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/TopBarView.swift @@ -41,7 +41,7 @@ struct TopBarView: View { var numberOfParticipants: some View { Text(viewModel.numberOfParticipantsLabel) - .foregroundColor(Color(StyleProvider.color.textSecondary)) + .foregroundColor(StyleProvider.color.foreground2) .font(.caption) } } From 3a0609c64f79087961ea513f7e4de0b8c9b77f65 Mon Sep 17 00:00:00 2001 From: Patrick Latter Date: Fri, 7 Feb 2025 14:42:59 -0800 Subject: [PATCH 4/7] Create FontProvider.swift --- .../Presentation/Style/FontProvider.swift | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/FontProvider.swift diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/FontProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/FontProvider.swift new file mode 100644 index 000000000..9098d112a --- /dev/null +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/FontProvider.swift @@ -0,0 +1,41 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// + +import Foundation +import FluentUI +import UIKit +import SwiftUICore + +class FontProvider { + private let fluentTheme = FluentTheme() + + let display: Font + let largeTitle: Font + let title1: Font + let title2: Font + let title3: Font + let body1Strong: Font + let body1: Font + let body2Strong: Font + let body2: Font + let caption1Strong: Font + let caption1: Font + let caption2: Font + + init(themeOptions: ThemeOptions?) { + self.display = Font(fluentTheme.typography(.display)) + self.largeTitle = Font(fluentTheme.typography(.largeTitle)) + self.title1 = Font(fluentTheme.typography(.title1)) + self.title2 = Font(fluentTheme.typography(.title2)) + self.title3 = Font(fluentTheme.typography(.title3)) + self.body1Strong = Font(fluentTheme.typography(.body1Strong)) + self.body1 = Font(fluentTheme.typography(.body1)) + self.body2Strong = Font(fluentTheme.typography(.body2Strong)) + self.body2 = Font(fluentTheme.typography(.body2)) + self.caption1Strong = Font(fluentTheme.typography(.caption1Strong)) + self.caption1 = Font(fluentTheme.typography(.caption1)) + self.caption2 = Font(fluentTheme.typography(.caption2)) + } +} From 2f78b5586a7b244e4fbf76b08e9181f1055f4391 Mon Sep 17 00:00:00 2001 From: Patrick Latter Date: Fri, 7 Feb 2025 15:11:07 -0800 Subject: [PATCH 5/7] Initial Calling Changes --- .../project.pbxproj | 4 + .../Sources/CallComposite.swift | 10 +- .../CallCompositeOptions/ThemeOptions.swift | 40 +-- .../FluentUI/Wrapper/CompositeButton.swift | 52 ++-- .../Style/ColorThemeProvider.swift | 280 +++++++++++------- .../Presentation/Style/StyleProvider.swift | 2 +- .../LobbyWaitingHeaderViewModel.swift | 2 +- .../PreviewAreaViewModel.swift | 2 +- .../SwiftUI/Utilities/FontExtension.swift | 8 +- .../Sources/Utilities/ThemeColor.swift | 10 +- 10 files changed, 237 insertions(+), 173 deletions(-) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/AzureCommunicationUICalling.xcodeproj/project.pbxproj b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/AzureCommunicationUICalling.xcodeproj/project.pbxproj index b3f71a978..ad16051e5 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/AzureCommunicationUICalling.xcodeproj/project.pbxproj +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/AzureCommunicationUICalling.xcodeproj/project.pbxproj @@ -318,6 +318,7 @@ A88CDFBC27505A410004E2F5 /* ErrorInfoViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A88CDFBB27505A410004E2F5 /* ErrorInfoViewModel.swift */; }; A8ED232D2645C637008A26B2 /* CallingServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8ED232C2645C637008A26B2 /* CallingServiceTests.swift */; }; A8ED23302649EA61008A26B2 /* NavigationRouterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8ED232F2649EA61008A26B2 /* NavigationRouterTests.swift */; }; + A8F202BD2D56BE6C005169C1 /* FontProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F202BC2D56BE68005169C1 /* FontProvider.swift */; }; B2120A5C2A97E35E00E29C05 /* UserFacingDiagnosticModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2120A5B2A97E35E00E29C05 /* UserFacingDiagnosticModel.swift */; }; B238378B2AA26EA7001F72B3 /* CallDiagnosticsReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B238378A2AA26EA7001F72B3 /* CallDiagnosticsReducer.swift */; }; B26F4B092ABA2F6B00753B6C /* BottomToastViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26F4B082ABA2F6B00753B6C /* BottomToastViewModelTests.swift */; }; @@ -744,6 +745,7 @@ A88CDFBB27505A410004E2F5 /* ErrorInfoViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorInfoViewModel.swift; sourceTree = ""; }; A8ED232C2645C637008A26B2 /* CallingServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallingServiceTests.swift; sourceTree = ""; }; A8ED232F2649EA61008A26B2 /* NavigationRouterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationRouterTests.swift; sourceTree = ""; }; + A8F202BC2D56BE68005169C1 /* FontProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontProvider.swift; sourceTree = ""; }; B2120A5B2A97E35E00E29C05 /* UserFacingDiagnosticModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserFacingDiagnosticModel.swift; sourceTree = ""; }; B238378A2AA26EA7001F72B3 /* CallDiagnosticsReducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallDiagnosticsReducer.swift; sourceTree = ""; }; B26F4B082ABA2F6B00753B6C /* BottomToastViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomToastViewModelTests.swift; sourceTree = ""; }; @@ -1151,6 +1153,7 @@ 1F94DADD2673E92300691D1E /* Style */ = { isa = PBXGroup; children = ( + A8F202BC2D56BE68005169C1 /* FontProvider.swift */, 759BDEFE28FF0B0A002B6853 /* LocalizationProvider.swift */, 759BDEF828FF0851002B6853 /* StyleProvider.swift */, 759BDEF628FF0839002B6853 /* ColorThemeProvider.swift */, @@ -2322,6 +2325,7 @@ 05CE90FD2C8E9985001ACA79 /* ButtonViewDataAction.swift in Sources */, 1F48B401274879F000B6E5F9 /* DiagnosticConfig.swift in Sources */, 051F73942C0E10BB006E097F /* ToastNotificationAction.swift in Sources */, + A8F202BD2D56BE6C005169C1 /* FontProvider.swift in Sources */, 05C1C828297F4830006EDD0D /* CallHistoryRecord.swift in Sources */, 9823AB4926A13F220006266D /* PreviewAreaView.swift in Sources */, 50FA46212698EA7A001844AC /* IconWithLabelButtonViewModel.swift in Sources */, diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallComposite.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallComposite.swift index fd3e40a59..4989bcec9 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallComposite.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallComposite.swift @@ -690,11 +690,11 @@ and launch(locator: JoinLocator, localOptions: LocalOptions? = nil) instead. private func setupColorTheming() { let colorProvider = ColorThemeProvider(themeOptions: themeOptions) StyleProvider.color = colorProvider - Task { @MainActor in - if let window = UIWindow.keyWindow { - Colors.setProvider(provider: colorProvider, for: window) - } - } +// Task { @MainActor in +// if let window = UIWindow.keyWindow { +// Colors.setProvider(provider: colorProvider, for: window) +// } +// } } private func setupLocalization(with provider: LocalizationProviderProtocol) { diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallCompositeOptions/ThemeOptions.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallCompositeOptions/ThemeOptions.swift index 6e6237008..94ecc94a8 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallCompositeOptions/ThemeOptions.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallCompositeOptions/ThemeOptions.swift @@ -36,24 +36,24 @@ public protocol ThemeOptions { } public extension ThemeOptions { - var colorSchemeOverride: UIUserInterfaceStyle { - return .unspecified - } - var primaryColor: UIColor { - return Colors.Palette.communicationBlue.color - } - var primaryColorTint10: UIColor { - return Colors.Palette.communicationBlueTint10.color - } - var primaryColorTint20: UIColor { - return Colors.Palette.communicationBlueTint20.color - } - var primaryColorTint30: UIColor { - return Colors.Palette.communicationBlueTint30.color - } - /* */ - var foregroundOnPrimaryColor: UIColor { - return UIColor.init(dynamicColor: Colors.surfacePrimary.dynamicColor!) - } - /* */ +// var colorSchemeOverride: UIUserInterfaceStyle { +// return .unspecified +// } +// var primaryColor: UIColor { +// return Colors.Palette.communicationBlue.color +// } +// var primaryColorTint10: UIColor { +// return Colors.Palette.communicationBlueTint10.color +// } +// var primaryColorTint20: UIColor { +// return Colors.Palette.communicationBlueTint20.color +// } +// var primaryColorTint30: UIColor { +// return Colors.Palette.communicationBlueTint30.color +// } +// /* */ +// var foregroundOnPrimaryColor: UIColor { +// return UIColor.init(dynamicColor: Colors.surfacePrimary.dynamicColor!) +// } +// /* */ } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/FluentUI/Wrapper/CompositeButton.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/FluentUI/Wrapper/CompositeButton.swift index 72229069e..72c00c826 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/FluentUI/Wrapper/CompositeButton.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/FluentUI/Wrapper/CompositeButton.swift @@ -52,32 +52,32 @@ struct CompositeButton: UIViewRepresentable { ) -> FluentUI.Button { let button = Button(style: buttonStyle) button.setTitle(buttonLabel, for: .normal) - /* */ - let dynamicColor = (buttonStyle == .borderless || - buttonStyle == .primaryOutline) - ? themeOptions.primaryColor.dynamicColor - : themeOptions.foregroundOnPrimaryColor.dynamicColor - var overrideTokens: [ButtonTokenSet.Tokens: ControlTokenValue] = [ - .foregroundColor: ControlTokenValue.dynamicColor({ - dynamicColor! - }), - .foregroundPressedColor: ControlTokenValue.dynamicColor({ - dynamicColor! - }), - .foregroundDisabledColor: ControlTokenValue.dynamicColor({ - Colors.gray300.dynamicColor! - }), - .borderColor: ControlTokenValue.dynamicColor({ - themeOptions.primaryColor.dynamicColor! - }) - ] - if buttonStyle == .primaryFilled { - overrideTokens[.backgroundColor] = .dynamicColor { - themeOptions.primaryColor.dynamicColor! - } - } - button.tokenSet.replaceAllOverrides(with: overrideTokens) - /* */ +// /* */ +// let dynamicColor = (buttonStyle == .borderless || +// buttonStyle == .primaryOutline) +// ? themeOptions.primaryColor.dynamicColor +// : themeOptions.foregroundOnPrimaryColor.dynamicColor +// var overrideTokens: [ButtonTokenSet.Tokens: ControlTokenValue] = [ +// .foregroundColor: ControlTokenValue.dynamicColor({ +// dynamicColor! +// }), +// .foregroundPressedColor: ControlTokenValue.dynamicColor({ +// dynamicColor! +// }), +// .foregroundDisabledColor: ControlTokenValue.dynamicColor({ +// Colors.gray300.dynamicColor! +// }), +// .borderColor: ControlTokenValue.dynamicColor({ +// themeOptions.primaryColor.dynamicColor! +// }) +// ] +// if buttonStyle == .primaryFilled { +// overrideTokens[.backgroundColor] = .dynamicColor { +// themeOptions.primaryColor.dynamicColor! +// } +// } +// button.tokenSet.replaceAllOverrides(with: overrideTokens) +// /* */ if let paddings = paddings { button.edgeInsets = getEdgeInserts(paddings) } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/ColorThemeProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/ColorThemeProvider.swift index e9b05a1d3..b9db74d88 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/ColorThemeProvider.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/ColorThemeProvider.swift @@ -6,98 +6,104 @@ import Foundation import FluentUI import UIKit +import SwiftUICore class ColorThemeProvider { + let fluentTheme = FluentTheme() let colorSchemeOverride: UIUserInterfaceStyle - let primaryColor: UIColor - let primaryColorTint10: UIColor - let primaryColorTint20: UIColor - let primaryColorTint30: UIColor - /* */ - let foregroundOnPrimaryColor: UIColor - /* */ - // MARK: Text Label Colours - let textSecondary: UIColor = Colors.textSecondary - - lazy var onWarning: UIColor = { - return dynamicColor(light: Colors.Palette.warningShade30.color, - dark: Colors.surfacePrimary) - }() - let onHoldBackground = UIColor.compositeColor(.onHoldBackground) - lazy var onError: UIColor = { - return dynamicColor(light: Colors.surfacePrimary, - dark: Colors.surfaceSecondary) - }() - lazy var onPrimary: UIColor = { - return dynamicColor(light: Colors.surfacePrimary, - dark: Colors.surfaceSecondary) - }() - lazy var onSuccess: UIColor = { - return dynamicColor(light: Colors.surfacePrimary, - dark: Colors.surfaceSecondary) - }() - lazy var onSurface: UIColor = { - return dynamicColor(light: Colors.Palette.gray950.color, - dark: Colors.textDominant) - }() - lazy var onBackground: UIColor = { - return dynamicColor(light: Colors.Palette.gray950.color, - dark: Colors.textDominant) - }() - lazy var onSurfaceColor: UIColor = { - return dynamicColor(light: Colors.Palette.gray950.color, - dark: Colors.textDominant) - }() - lazy var onNavigationSecondary: UIColor = { - return dynamicColor(light: Colors.textSecondary, - dark: Colors.textDominant) - }() - - // MARK: - Button Icon Colours - let hangup = UIColor.compositeColor(.hangup) - let disableColor: UIColor = Colors.iconDisabled - let drawerIconDark: UIColor = Colors.iconSecondary - - // MARK: - View Background Colours - let error: UIColor = Colors.error - let success: UIColor = Colors.Palette.successPrimary.color - lazy var warning: UIColor = { - return dynamicColor(light: Colors.Palette.warningTint40.color, - dark: Colors.warning) - }() - let overlay = UIColor.compositeColor(.overlay) - let gridLayoutBackground: UIColor = Colors.surfacePrimary - let gradientColor = UIColor.black.withAlphaComponent(0.7) - let surfaceDarkColor = UIColor.black.withAlphaComponent(0.6) - let surfaceLightColor = UIColor.black.withAlphaComponent(0.3) - lazy var backgroundColor: UIColor = { - return dynamicColor(light: Colors.surfacePrimary, - dark: Colors.surfaceSecondary) - }() - lazy var drawerColor: UIColor = { - return dynamicColor(light: Colors.surfacePrimary, - dark: Colors.Palette.gray900.color) - }() - lazy var popoverColor: UIColor = { - return dynamicColor(light: Colors.surfacePrimary, - dark: Colors.surfaceQuaternary) - }() - lazy var surface: UIColor = { - return dynamicColor(light: Colors.surfaceQuaternary, - dark: Colors.Palette.gray800.color) - }() +// let primaryColor: UIColor +// let primaryColorTint10: UIColor +// let primaryColorTint20: UIColor +// let primaryColorTint30: UIColor +// /* */ +// let foregroundOnPrimaryColor: UIColor +// /* */ +// // MARK: Text Label Colours +// let textSecondary: UIColor = Colors.textSecondary +// +// lazy var onWarning: UIColor = { +// return dynamicColor(light: Colors.Palette.warningShade30.color, +// dark: Colors.surfacePrimary) +// }() +// let onHoldBackground = UIColor.compositeColor(.onHoldBackground) +// lazy var onError: UIColor = { +// return dynamicColor(light: Colors.surfacePrimary, +// dark: Colors.surfaceSecondary) +// }() +// lazy var onPrimary: UIColor = { +// return dynamicColor(light: Colors.surfacePrimary, +// dark: Colors.surfaceSecondary) +// }() +// lazy var onSuccess: UIColor = { +// return dynamicColor(light: Colors.surfacePrimary, +// dark: Colors.surfaceSecondary) +// }() +// lazy var onSurface: UIColor = { +// return dynamicColor(light: Colors.Palette.gray950.color, +// dark: Colors.textDominant) +// }() +// lazy var onBackground: UIColor = { +// return dynamicColor(light: Colors.Palette.gray950.color, +// dark: Colors.textDominant) +// }() +// lazy var onSurfaceColor: UIColor = { +// return dynamicColor(light: Colors.Palette.gray950.color, +// dark: Colors.textDominant) +// }() +// lazy var onNavigationSecondary: UIColor = { +// return dynamicColor(light: Colors.textSecondary, +// dark: Colors.textDominant) +// }() + +// // MARK: - Button Icon Colours +// let hangup = UIColor.compositeColor(.hangup) +// let disableColor: UIColor = Colors.iconDisabled +// let drawerIconDark: UIColor = Colors.iconSecondary +// +// // MARK: - View Background Colours +// let error: UIColor = Colors.error +// let success: UIColor = Colors.Palette.successPrimary.color +// lazy var warning: UIColor = { +// return dynamicColor(light: Colors.Palette.warningTint40.color, +// dark: Colors.warning) +// }() +// let overlay = UIColor.compositeColor(.overlay) +// let gridLayoutBackground: UIColor = Colors.surfacePrimary +// let gradientColor = UIColor.black.withAlphaComponent(0.7) +// let surfaceDarkColor = UIColor.black.withAlphaComponent(0.6) +// let surfaceLightColor = UIColor.black.withAlphaComponent(0.3) +// lazy var backgroundColor: UIColor = { +// return dynamicColor(light: Colors.surfacePrimary, +// dark: Colors.surfaceSecondary) +// }() +// lazy var drawerColor: UIColor = { +// return dynamicColor(light: Colors.surfacePrimary, +// dark: Colors.Palette.gray900.color) +// }() +// lazy var popoverColor: UIColor = { +// return dynamicColor(light: Colors.surfacePrimary, +// dark: Colors.surfaceQuaternary) +// }() +// lazy var surface: UIColor = { +// return dynamicColor(light: Colors.surfaceQuaternary, +// dark: Colors.Palette.gray800.color) +// }() + + let foreground3: Color init(themeOptions: ThemeOptions?) { self.colorSchemeOverride = themeOptions?.colorSchemeOverride ?? .unspecified - self.primaryColor = themeOptions?.primaryColor ?? Colors.Palette.communicationBlue.color - self.primaryColorTint10 = themeOptions?.primaryColorTint10 ?? Colors.Palette.communicationBlueTint10.color - self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? Colors.Palette.communicationBlueTint20.color - self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? Colors.Palette.communicationBlueTint30.color - /* */ - self.foregroundOnPrimaryColor = themeOptions?.foregroundOnPrimaryColor ?? .orange - /* */ +// self.primaryColor = themeOptions?.primaryColor ?? Colors.Palette.communicationBlue.color +// self.primaryColorTint10 = themeOptions?.primaryColorTint10 ?? Colors.Palette.communicationBlueTint10.color +// self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? Colors.Palette.communicationBlueTint20.color +// self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? Colors.Palette.communicationBlueTint30.color +// /* */ +// self.foregroundOnPrimaryColor = themeOptions?.foregroundOnPrimaryColor ?? .orange +// /* */ + + self.foreground3 = fluentTheme.swiftUIColor(.foreground3) } private func dynamicColor(light: UIColor, dark: UIColor) -> UIColor { @@ -106,39 +112,93 @@ class ColorThemeProvider { } extension ColorThemeProvider: ColorProviding { - func primaryColor(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackground1: UIColor { + return fluentTheme.color(.brandBackground1) } - /* */ - func foregroundOnPrimaryColor(for window: UIWindow) -> UIColor? { - return foregroundOnPrimaryColor + var brandBackground1Pressed: UIColor { + return fluentTheme.color(.brandBackground1Pressed) } - /* */ - func primaryTint10Color(for window: UIWindow) -> UIColor? { - return primaryColorTint10 + var brandBackground1Selected: UIColor { + return fluentTheme.color(.brandBackground1Selected) } - - func primaryTint20Color(for window: UIWindow) -> UIColor? { - return primaryColorTint20 + var brandBackground2: UIColor { + return fluentTheme.color(.brandBackground2) } - - func primaryTint30Color(for window: UIWindow) -> UIColor? { - return primaryColorTint30 + var brandBackground2Pressed: UIColor { + return fluentTheme.color(.brandBackground2Pressed) } - - func primaryTint40Color(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackground2Selected: UIColor { + return fluentTheme.color(.brandBackground2Selected) } - - func primaryShade10Color(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackground3: UIColor { + return fluentTheme.color(.background3) } - - func primaryShade20Color(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackgroundTint: UIColor { + return fluentTheme.color(.brandBackgroundTint) } - - func primaryShade30Color(for window: UIWindow) -> UIColor? { - return primaryColor + var brandBackgroundDisabled: UIColor { + return fluentTheme.color(.brandBackgroundDisabled) + } + var brandForeground1: UIColor { + return fluentTheme.color(.brandForeground1) + } + var brandForeground1Pressed: UIColor { + return fluentTheme.color(.brandForeground1Pressed) } + var brandForeground1Selected: UIColor { + return fluentTheme.color(.brandForeground1Selected) + } + var brandForegroundTint: UIColor { + return fluentTheme.color(.brandForegroundTint) + } + var brandForegroundDisabled1: UIColor { + return fluentTheme.color(.brandForegroundDisabled1) + } + var brandForegroundDisabled2: UIColor { + return fluentTheme.color(.brandForegroundDisabled2) + } + var brandStroke1: UIColor { + return fluentTheme.color(.brandStroke1) + } + var brandStroke1Pressed: UIColor { + return fluentTheme.color(.brandStroke1Pressed) + } + var brandStroke1Selected: UIColor { + return fluentTheme.color(.brandStroke1Selected) + } +// func primaryColor(for window: UIWindow) -> UIColor? { +// return primaryColor +// } +// /* */ +// func foregroundOnPrimaryColor(for window: UIWindow) -> UIColor? { +// return foregroundOnPrimaryColor +// } +// /* */ +// func primaryTint10Color(for window: UIWindow) -> UIColor? { +// return primaryColorTint10 +// } +// +// func primaryTint20Color(for window: UIWindow) -> UIColor? { +// return primaryColorTint20 +// } +// +// func primaryTint30Color(for window: UIWindow) -> UIColor? { +// return primaryColorTint30 +// } +// +// func primaryTint40Color(for window: UIWindow) -> UIColor? { +// return primaryColor +// } +// +// func primaryShade10Color(for window: UIWindow) -> UIColor? { +// return primaryColor +// } +// +// func primaryShade20Color(for window: UIWindow) -> UIColor? { +// return primaryColor +// } +// +// func primaryShade30Color(for window: UIWindow) -> UIColor? { +// return primaryColor +// } } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/StyleProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/StyleProvider.swift index 4362ad3a5..4ff2267aa 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/StyleProvider.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/StyleProvider.swift @@ -8,5 +8,5 @@ import Foundation struct StyleProvider { static var color = ColorThemeProvider(themeOptions: nil) static var icon = IconProvider() - // static var font = FontProvider() + static var font = FontProvider(themeOptions: nil) } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyWaitingHeaderViewModel.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyWaitingHeaderViewModel.swift index 209c93dc4..acacdf489 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyWaitingHeaderViewModel.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyWaitingHeaderViewModel.swift @@ -35,7 +35,7 @@ internal class LobbyWaitingHeaderViewModel: ObservableObject { self.accessibilityLabel = title self.participantListButtonViewModel = compositeViewModelFactory.makePrimaryButtonViewModel( - buttonStyle: .primaryFilled, + buttonStyle: .accent, buttonLabel: localizationProvider.getLocalizedString(.lobbyWaitingHeaderViewButton), iconName: nil, isDisabled: false, diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/PreviewAreaViewModel.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/PreviewAreaViewModel.swift index 2b1e4e1d3..afeb6b013 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/PreviewAreaViewModel.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/PreviewAreaViewModel.swift @@ -24,7 +24,7 @@ class PreviewAreaViewModel: ObservableObject { self.localizationProvider = localizationProvider goToSettingsButtonViewModel = compositeViewModelFactory.makePrimaryButtonViewModel( - buttonStyle: .primaryOutline, + buttonStyle: .outlineAccent, buttonLabel: self.localizationProvider .getLocalizedString(.goToSettings)) { [weak self] in guard let self = self else { diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Utilities/FontExtension.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Utilities/FontExtension.swift index d8c3f3129..069cb4399 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Utilities/FontExtension.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Utilities/FontExtension.swift @@ -13,7 +13,7 @@ extension UIFont { } } -extension Fonts { - static var button1Accessibility: UIFont { return Fonts.button1.withSize(26) } - static var button2Accessibility: UIFont { return Fonts.button2.withSize(20) } -} +// extension Font { +// static var button1Accessibility: UIFont { return Fonts.button1.withSize(26) } +// static var button2Accessibility: UIFont { return Fonts.button2.withSize(20) } +// } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Utilities/ThemeColor.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Utilities/ThemeColor.swift index a6b843573..14db6b675 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Utilities/ThemeColor.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Utilities/ThemeColor.swift @@ -12,19 +12,19 @@ class ThemeColor: ThemeOptions { return .unspecified } var primaryColor: UIColor { - return Colors.Palette.communicationBlue.color + return StyleProvider.color.brandBackground1 } var primaryColorTint10: UIColor { - return Colors.Palette.communicationBlueTint10.color + return StyleProvider.color.brandBackground1 } var primaryColorTint20: UIColor { - return Colors.Palette.communicationBlueTint20.color + return StyleProvider.color.brandBackground1 } var primaryColorTint30: UIColor { - return Colors.Palette.communicationBlueTint30.color + return StyleProvider.color.brandBackground1 } /* */ var foregroundOnPrimaryColor: UIColor { - return UIColor.init(dynamicColor: Colors.surfacePrimary.dynamicColor!) + return StyleProvider.color.brandBackground1 } } From 60a6dd3a2fe4890e67252a3376e3156e53b6aff4 Mon Sep 17 00:00:00 2001 From: Patrick Latter Date: Mon, 10 Feb 2025 14:39:03 -0800 Subject: [PATCH 6/7] Update calling --- .../CallCompositeOptions/ThemeOptions.swift | 22 ++++++-- .../FluentUI/Wrapper/CompositeAvatar.swift | 2 +- .../Style/ColorThemeProvider.swift | 54 +++++++++++++++---- .../Presentation/Style/FontProvider.swift | 9 ++++ .../Banner/BannerTextView.swift | 2 +- .../Captions/CaptionsErrorView.swift | 2 +- .../CallingViewComponent/InfoHeaderView.swift | 4 +- .../LobbyErrorHeaderView.swift | 2 +- .../LobbyWaitingHeaderView.swift | 2 +- .../Overlay/LoadingOverlayView.swift | 4 +- .../Overlay/LobbyOverlayView.swift | 4 +- .../Overlay/OnHoldOverlayViewModel.swift | 2 +- .../Cell/ParticipantGridCellVideoView.swift | 4 +- .../Grid/Cell/ParticipantGridCellView.swift | 4 +- .../SwiftUI/Setup/SetupView.swift | 4 +- .../JoiningCallActivityView.swift | 2 +- .../SetupViewComponent/PreviewAreaView.swift | 2 +- .../SwiftUI/Setup/SetupViewModel.swift | 2 +- .../Button/IconWithLabelButton.swift | 4 +- .../CustomAlert/CustomAlert.swift | 4 +- .../MessageBarDiagnosticView.swift | 2 +- .../Drawer/Views/DrawerBodyTextView.swift | 2 +- .../ViewComponents/Error/ErrorInfoView.swift | 6 +-- .../SupportForm/SupportFormView.swift | 12 ++--- .../ToastNotification/BottomToastView.swift | 2 +- .../VideoView/LocalVideoView.swift | 2 +- .../Message/TextMessageView.swift | 4 +- 27 files changed, 113 insertions(+), 52 deletions(-) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallCompositeOptions/ThemeOptions.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallCompositeOptions/ThemeOptions.swift index 94ecc94a8..9ce700c1c 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallCompositeOptions/ThemeOptions.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/CallCompositeOptions/ThemeOptions.swift @@ -36,9 +36,25 @@ public protocol ThemeOptions { } public extension ThemeOptions { -// var colorSchemeOverride: UIUserInterfaceStyle { -// return .unspecified -// } + var colorSchemeOverride: UIUserInterfaceStyle { + return .unspecified + } + var primaryColor: UIColor { + return UIColor.blue + } + var primaryColorTint10: UIColor { + return UIColor.blue + } + var primaryColorTint20: UIColor { + return UIColor.blue + } + var primaryColorTint30: UIColor { + return UIColor.blue + } + /* */ + var foregroundOnPrimaryColor: UIColor { + return UIColor.white + } // var primaryColor: UIColor { // return Colors.Palette.communicationBlue.color // } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/FluentUI/Wrapper/CompositeAvatar.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/FluentUI/Wrapper/CompositeAvatar.swift index 9915740ca..cc836a2d1 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/FluentUI/Wrapper/CompositeAvatar.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/FluentUI/Wrapper/CompositeAvatar.swift @@ -19,7 +19,7 @@ struct CompositeAvatar: View { size: avatarSize, image: avatarImage, primaryText: displayName) - .ringColor(StyleProvider.color.primaryColor) + .ringColor(StyleProvider.color.brandForegroundTint) .isRingVisible(isSpeaking) .accessibilityHidden(true) } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/ColorThemeProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/ColorThemeProvider.swift index b9db74d88..8a87126ed 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/ColorThemeProvider.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/ColorThemeProvider.swift @@ -90,20 +90,56 @@ class ColorThemeProvider { // dark: Colors.Palette.gray800.color) // }() - let foreground3: Color + let surfaceDarkColor: UIColor + let drawerColor: UIColor + let surface: UIColor + let onHoldBackground: UIColor + let backgroundColor: UIColor + let warning: UIColor + let onWarning: UIColor + let gridLayoutBackground: UIColor + let disableColor: UIColor + let overlay: UIColor + let textSecondary: UIColor + let hangup: UIColor + let surfaceLightColor: UIColor + let onSurface: UIColor + let onSurfaceColor: UIColor + let onBackground: UIColor + let onNavigationSecondary: UIColor + let gradientColor: UIColor init(themeOptions: ThemeOptions?) { self.colorSchemeOverride = themeOptions?.colorSchemeOverride ?? .unspecified -// self.primaryColor = themeOptions?.primaryColor ?? Colors.Palette.communicationBlue.color -// self.primaryColorTint10 = themeOptions?.primaryColorTint10 ?? Colors.Palette.communicationBlueTint10.color -// self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? Colors.Palette.communicationBlueTint20.color -// self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? Colors.Palette.communicationBlueTint30.color -// /* */ -// self.foregroundOnPrimaryColor = themeOptions?.foregroundOnPrimaryColor ?? .orange -// /* */ + // self.primaryColor = themeOptions?.primaryColor ?? Colors.Palette.communicationBlue.color + // self.primaryColorTint10 = themeOptions?.primaryColorTint10 ?? Colors.Palette.communicationBlueTint10.color + // self.primaryColorTint20 = themeOptions?.primaryColorTint20 ?? Colors.Palette.communicationBlueTint20.color + // self.primaryColorTint30 = themeOptions?.primaryColorTint30 ?? Colors.Palette.communicationBlueTint30.color + // /* */ + // self.foregroundOnPrimaryColor = themeOptions?.foregroundOnPrimaryColor ?? .orange + // /* */ - self.foreground3 = fluentTheme.swiftUIColor(.foreground3) + // Search and replace to put correct names in code + + self.surfaceDarkColor = UIColor.black.withAlphaComponent(0.6) // Replace with Fluent + self.drawerColor = fluentTheme.color(.background1) + self.surface = fluentTheme.color(.background4) + self.onHoldBackground = UIColor.compositeColor(.onHoldBackground) // Replace with fluent + self.backgroundColor = fluentTheme.color(.background1) // Double check dark mode + self.warning = fluentTheme.color(.dangerBackground1) // Double check + self.onWarning = fluentTheme.color(.dangerForeground1) // Double check + self.gridLayoutBackground = fluentTheme.color(.background1) // Duplicate? + self.disableColor = fluentTheme.color(.foregroundDisabled1) // Double check + self.overlay = UIColor.compositeColor(.overlay) // Replace with Fluent + self.textSecondary = fluentTheme.color(.foreground2) // Double check + self.hangup = UIColor.compositeColor(.hangup) // Replace with Fluent + self.surfaceLightColor = UIColor.black.withAlphaComponent(0.3) // Replace with Fluent + self.onSurface = fluentTheme.color(.foreground2) // Double check + self.onSurfaceColor = fluentTheme.color(.foreground2) // Duplicate + self.onBackground = fluentTheme.color(.foreground2) // Duplicate + self.onNavigationSecondary = fluentTheme.color(.foreground2) // Double Check + self.gradientColor = UIColor.black.withAlphaComponent(0.7) // Replace with Fluent } private func dynamicColor(light: UIColor, dark: UIColor) -> UIColor { diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/FontProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/FontProvider.swift index 9098d112a..1e5677522 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/FontProvider.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/Style/FontProvider.swift @@ -24,6 +24,9 @@ class FontProvider { let caption1: Font let caption2: Font + let body2StrongAccessibility: Font + let caption1StrongAccessiblity: Font + init(themeOptions: ThemeOptions?) { self.display = Font(fluentTheme.typography(.display)) self.largeTitle = Font(fluentTheme.typography(.largeTitle)) @@ -37,5 +40,11 @@ class FontProvider { self.caption1Strong = Font(fluentTheme.typography(.caption1Strong)) self.caption1 = Font(fluentTheme.typography(.caption1)) self.caption2 = Font(fluentTheme.typography(.caption2)) + + // Add accessibility fonts + // static var button1Accessibility: UIFont { return Fonts.button1.withSize(26) } + // static var button2Accessibility: UIFont { return Fonts.button2.withSize(20) } + self.body2StrongAccessibility = Font(fluentTheme.typography(.body2Strong)) + self.caption1StrongAccessiblity = Font(fluentTheme.typography(.caption1Strong)) } } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Banner/BannerTextView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Banner/BannerTextView.swift index 6bec51adc..57b51f6ac 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Banner/BannerTextView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Banner/BannerTextView.swift @@ -17,7 +17,7 @@ struct BannerTextView: View { + Text(" ") + Text(viewModel.linkDisplay).underline() } - .font(Fonts.footnote.font) + .font(StyleProvider.font.body1Strong) .accessibilityElement(children: .ignore) .accessibilityLabel(Text(viewModel.accessibilityLabel)) .accessibilityAddTraits(.isLink) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Captions/CaptionsErrorView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Captions/CaptionsErrorView.swift index ccec4126d..b380b7c00 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Captions/CaptionsErrorView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Captions/CaptionsErrorView.swift @@ -28,7 +28,7 @@ struct CaptionsErrorView: View { .accessibilityHidden(true) } Text(viewModel.text) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) .padding( EdgeInsets(top: verticalPadding, leading: 0, diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/InfoHeaderView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/InfoHeaderView.swift index 55adc3939..366e726b4 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/InfoHeaderView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/InfoHeaderView.swift @@ -83,7 +83,7 @@ struct InfoHeaderView: View { .alignmentGuide(.leading) { d in d[.leading] } .foregroundColor(Constants.foregroundColor) .lineLimit(1) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) .accessibilityLabel(Text(viewModel.accessibilityLabelTitle)) .accessibilitySortPriority(1) .scaledToFit() @@ -95,7 +95,7 @@ struct InfoHeaderView: View { .alignmentGuide(.leading) { d in d[.leading] } .foregroundColor(Constants.foregroundColor) .lineLimit(1) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) .accessibilityLabel(Text(viewModel.accessibilityLabelSubtitle)) .accessibilitySortPriority(2) .scaledToFit() diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyErrorHeaderView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyErrorHeaderView.swift index e361fb23b..ce4aeba0f 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyErrorHeaderView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyErrorHeaderView.swift @@ -53,7 +53,7 @@ struct LobbyErrorHeaderView: View { bottom: Constants.labelHorizontalPadding, trailing: 0)) .foregroundColor(Constants.foregroundColor) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) .accessibilityLabel(Text(viewModel.accessibilityLabel)) .accessibilitySortPriority(1) Spacer() diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyWaitingHeaderView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyWaitingHeaderView.swift index 2c36bac51..4c6df8eed 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyWaitingHeaderView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/LobbyWaitingHeaderView.swift @@ -52,7 +52,7 @@ internal struct LobbyWaitingHeaderView: View { bottom: Constants.infoLabelHorizontalPadding, trailing: 0)) .foregroundColor(Constants.foregroundColor) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) .accessibilityLabel(Text(viewModel.accessibilityLabel)) .accessibilitySortPriority(1) Spacer() diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/LoadingOverlayView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/LoadingOverlayView.swift index 95d661cbf..bdca96523 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/LoadingOverlayView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/LoadingOverlayView.swift @@ -24,9 +24,9 @@ struct LoadingOverlayView: View { Group { ActivityIndicator(size: .medium) .isAnimating(true) - .color(Colors.Palette.communicationBlue.color) + .color(StyleProvider.color.brandForegroundTint) // Should be forced to be commBlue? Text(viewModel.title) - .font(Fonts.title2.font) + .font(StyleProvider.font.title2) } .padding(.horizontal, horizontalPaddingSize) .accessibilityElement(children: .combine) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/LobbyOverlayView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/LobbyOverlayView.swift index 837bb95be..7683e2a2c 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/LobbyOverlayView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/LobbyOverlayView.swift @@ -28,11 +28,11 @@ struct OverlayView: View { .padding(.bottom, verticalIconPaddingSize) Text(viewModel.title) - .font(Fonts.title2.font) + .font(StyleProvider.font.title2) .multilineTextAlignment(.center) if let subtitle = viewModel.subtitle { Text(subtitle) - .font(Fonts.subhead.font) + .font(StyleProvider.font.body2) .multilineTextAlignment(.center) .padding(.top, verticalSubtitlePaddingSize) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/OnHoldOverlayViewModel.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/OnHoldOverlayViewModel.swift index 0e3cd87c8..c59871bf1 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/OnHoldOverlayViewModel.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/CallingViewComponent/Overlay/OnHoldOverlayViewModel.swift @@ -44,7 +44,7 @@ class OnHoldOverlayViewModel: OverlayViewModelProtocol, ObservableObject { subtitle: errorInfoSubtitle) self.resumeAction = resumeAction self.actionButtonViewModel = compositeViewModelFactory.makePrimaryButtonViewModel( - buttonStyle: .primaryFilled, + buttonStyle: .accent, buttonLabel: localizationProvider.getLocalizedString(.resume), iconName: nil, isDisabled: false) { [weak self] in diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/Grid/Cell/ParticipantGridCellVideoView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/Grid/Cell/ParticipantGridCellVideoView.swift index 7cd94c533..da282ca15 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/Grid/Cell/ParticipantGridCellVideoView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/Grid/Cell/ParticipantGridCellVideoView.swift @@ -30,7 +30,7 @@ struct ParticipantGridCellVideoView: View { ParticipantTitleView(displayName: $displayName, isMuted: $isMuted, isHold: .constant(false), - titleFont: Fonts.caption1.font, + titleFont: StyleProvider.font.caption1, mutedIconSize: 14) .padding(.vertical, 2) .background(Color(StyleProvider.color.overlay)) @@ -41,7 +41,7 @@ struct ParticipantGridCellVideoView: View { }.overlay( isSpeaking && !isMuted ? RoundedRectangle(cornerRadius: 4) - .strokeBorder(Color(StyleProvider.color.primaryColor), lineWidth: 4) : nil + .strokeBorder(Color(StyleProvider.color.brandForegroundTint), lineWidth: 4) : nil ).animation(.default, value: show) } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/Grid/Cell/ParticipantGridCellView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/Grid/Cell/ParticipantGridCellView.swift index 01f7b4514..edc0107e1 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/Grid/Cell/ParticipantGridCellView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Calling/Grid/Cell/ParticipantGridCellView.swift @@ -90,12 +90,12 @@ struct ParticipantGridCellView: View { ParticipantTitleView(displayName: $viewModel.displayName, isMuted: $viewModel.isMuted, isHold: $viewModel.isHold, - titleFont: Fonts.caption1.font, + titleFont: StyleProvider.font.caption1, mutedIconSize: 16) .opacity(viewModel.isHold ? 0.6 : 1) if viewModel.isHold { Text(viewModel.getOnHoldString()) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) .lineLimit(1) .foregroundColor(Color(StyleProvider.color.onBackground)) .padding(.top, 8) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupView.swift index 131107dea..0a805c29f 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupView.swift @@ -143,14 +143,14 @@ struct SetupTitleView: View { Spacer() VStack { Text(viewModel.title) - .font(Fonts.headline.font) + .font(StyleProvider.font.body1Strong) .foregroundColor(Color(StyleProvider.color.onBackground)) .lineLimit(1) .minimumScaleFactor(sizeCategory.isAccessibilityCategory ? 0.4 : 1) .accessibilityAddTraits(.isHeader) if let subtitle = viewModel.subTitle, !subtitle.isEmpty { Text(subtitle) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) .foregroundColor(Color(StyleProvider.color.onNavigationSecondary)) .lineLimit(1) .minimumScaleFactor(sizeCategory.isAccessibilityCategory ? 0.4 : 1) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/JoiningCallActivityView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/JoiningCallActivityView.swift index 0fa6c9aef..a4be25599 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/JoiningCallActivityView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/JoiningCallActivityView.swift @@ -16,7 +16,7 @@ struct JoiningCallActivityView: View { ActivityIndicator(size: .small) .isAnimating(true) Text(viewModel.title) - .font(Fonts.subhead.font) + .font(StyleProvider.font.body2) .foregroundColor(Color(StyleProvider.color.onSurfaceColor)) Spacer() }.frame(height: containerHeight) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/PreviewAreaView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/PreviewAreaView.swift index fdcccbe53..49a820925 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/PreviewAreaView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewComponent/PreviewAreaView.swift @@ -53,7 +53,7 @@ struct PermissionWarningView: View { .foregroundColor(Color(StyleProvider.color.onSurface)) Text(displayText) .padding(.horizontal, Constants.horizontalSpacing) - .font(Fonts.subhead.font) + .font(StyleProvider.font.body2) .multilineTextAlignment(.center) .foregroundColor(Color(StyleProvider.color.onSurface)) PrimaryButton(viewModel: goToSettingsButtonViewModel) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewModel.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewModel.swift index 0fc03eae0..65e5da344 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewModel.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/Setup/SetupViewModel.swift @@ -78,7 +78,7 @@ class SetupViewModel: ObservableObject { } joinCallButtonViewModel = compositeViewModelFactory.makePrimaryButtonViewModel( - buttonStyle: .primaryFilled, + buttonStyle: .accent, buttonLabel: self.localizationProvider .getLocalizedString(callButtonLocalization), iconName: .meetNow, diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Button/IconWithLabelButton.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Button/IconWithLabelButton.swift index e25fdf4e0..f58120315 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Button/IconWithLabelButton.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Button/IconWithLabelButton.swift @@ -34,10 +34,10 @@ struct IconWithLabelButton: View { if let buttonLabel = viewModel.buttonLabel { if sizeCategory >= ContentSizeCategory.accessibilityMedium { Text(buttonLabel) - .font(Fonts.button2Accessibility.font) + .font(StyleProvider.font.caption1StrongAccessiblity) } else { Text(buttonLabel) - .font(Fonts.button2.font) + .font(StyleProvider.font.caption1Strong) } } } diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/CustomAlert/CustomAlert.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/CustomAlert/CustomAlert.swift index 13ec4f2b7..1fc9f1f2a 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/CustomAlert/CustomAlert.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/CustomAlert/CustomAlert.swift @@ -53,7 +53,7 @@ internal struct CustomAlert: View { height: CustomAlertConstants.confirmationButtonHeight, alignment: .center ) - .foregroundColor(Color(StyleProvider.color.primaryColor)) + .foregroundColor(Color(StyleProvider.color.brandForegroundTint)) }) Divider().frame(maxHeight: CustomAlertConstants.confirmationButtonHeight) Button(action: { @@ -64,7 +64,7 @@ internal struct CustomAlert: View { .frame(width: CustomAlertConstants.confirmationButtonWidth, height: CustomAlertConstants.confirmationButtonHeight, alignment: .center) - .foregroundColor(Color(StyleProvider.color.primaryColor)) + .foregroundColor(Color(StyleProvider.color.brandForegroundTint)) }) } }.padding() diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Diagnostics/MessageBarDiagnosticView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Diagnostics/MessageBarDiagnosticView.swift index ee56e2fa8..5f0e84a99 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Diagnostics/MessageBarDiagnosticView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Diagnostics/MessageBarDiagnosticView.swift @@ -28,7 +28,7 @@ struct MessageBarDiagnosticView: View { .accessibilityHidden(true) } Text(viewModel.text) - .font(Fonts.footnote.font) + .font(StyleProvider.font.caption1) .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 16)) .multilineTextAlignment(.center) .foregroundColor(foregroundColor) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Drawer/Views/DrawerBodyTextView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Drawer/Views/DrawerBodyTextView.swift index fabbbeedc..81d9c3afd 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Drawer/Views/DrawerBodyTextView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Drawer/Views/DrawerBodyTextView.swift @@ -42,7 +42,7 @@ internal struct DrawerBodyWithActionTextView: View { .onTapGesture { isConfirming = true } - .foregroundColor(Color(StyleProvider.color.primaryColor)) + .foregroundColor(Color(StyleProvider.color.brandForegroundTint)) } .padding(.horizontal, DrawerListConstants.optionPaddingHorizontal) .padding(.vertical, DrawerListConstants.optionPaddingVertical) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Error/ErrorInfoView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Error/ErrorInfoView.swift index ff92589a9..3f69ce2bd 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Error/ErrorInfoView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/Error/ErrorInfoView.swift @@ -16,13 +16,13 @@ struct ErrorInfoView: View { HStack { VStack(alignment: .leading, spacing: 0) { Text(viewModel.title) - .font(Fonts.button1.font) + .font(StyleProvider.font.body2Strong) .foregroundColor(Color(StyleProvider.color.onWarning)) .accessibilitySortPriority(1) if !viewModel.subtitle.isEmpty { Text(viewModel.subtitle) - .font(Fonts.subhead.font) + .font(StyleProvider.font.body2) .foregroundColor(Color(StyleProvider.color.onWarning)) .accessibilitySortPriority(2) } @@ -30,7 +30,7 @@ struct ErrorInfoView: View { Spacer() Button(action: viewModel.dismiss) { Text(viewModel.dismissContent) - .font(Fonts.button1.font) + .font(StyleProvider.font.body2Strong) .foregroundColor(Color(StyleProvider.color.onWarning)) } .padding([.top, .bottom, .trailing]) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/SupportForm/SupportFormView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/SupportForm/SupportFormView.swift index 6bb08bd50..84989d0df 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/SupportForm/SupportFormView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/SupportForm/SupportFormView.swift @@ -32,11 +32,11 @@ internal struct SupportFormView: View { Button(viewModel.cancelButtonText) { viewModel.hideForm() } - .font(Fonts.button2.font) + .font(StyleProvider.font.caption1Strong) .foregroundColor(Color(StyleProvider.color.onBackground)) Spacer() Text(viewModel.reportAProblemText) - .font(Fonts.subhead.font) + .font(StyleProvider.font.body2) Spacer() Button(viewModel.sendFeedbackText) { viewModel.sendReport() @@ -44,7 +44,7 @@ internal struct SupportFormView: View { .accessibilityIdentifier(AccessibilityIdentifier.supportFormSubmitAccessibilityId.rawValue) .disabled(viewModel.blockSubmission) .opacity(viewModel.blockSubmission ? Constants.disabledOpacity : Constants.enabledOpacity) - .font(Fonts.button2.font) + .font(StyleProvider.font.caption1Strong) .foregroundColor(Color(StyleProvider.color.onBackground)) } ZStack(alignment: .topLeading) { @@ -63,10 +63,10 @@ internal struct SupportFormView: View { } HStack { Text(viewModel.logsAttachNotice) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) Link(viewModel.privacyPolicyText, destination: URL(string: StringConstants.privacyPolicyLink)!) - .foregroundColor(Color(StyleProvider.color.primaryColor)) - .font(Fonts.caption2.font) + .foregroundColor(Color(StyleProvider.color.brandForegroundTint)) + .font(StyleProvider.font.caption2) Spacer() #if DEBUG // Hidden button for injecting text diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/ToastNotification/BottomToastView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/ToastNotification/BottomToastView.swift index f184754ae..1fd4b42f6 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/ToastNotification/BottomToastView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/ToastNotification/BottomToastView.swift @@ -28,7 +28,7 @@ struct BottomToastView: View { .accessibilityHidden(true) } Text(viewModel.text) - .font(Fonts.caption1.font) + .font(StyleProvider.font.caption1) .padding( EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: horizontalPadding)) .multilineTextAlignment(.center) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/VideoView/LocalVideoView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/VideoView/LocalVideoView.swift index 40dc2ac9a..31a695430 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/VideoView/LocalVideoView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUICalling/Sources/Presentation/SwiftUI/ViewComponents/VideoView/LocalVideoView.swift @@ -96,7 +96,7 @@ struct LocalVideoView: View { ParticipantTitleView(displayName: $viewModel.displayName, isMuted: $viewModel.isMuted, isHold: .constant(false), - titleFont: Fonts.caption1.font, + titleFont: StyleProvider.font.caption1, mutedIconSize: 16) } else if screenSizeClass == .iphonePortraitScreenSize { Spacer() diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift index c443d37f0..60c7302e4 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift @@ -106,13 +106,13 @@ struct TextMessageView: View { private func getMessageBubbleBackground(messageModel: ChatMessageInfoModel) -> Color { guard messageModel.isLocalUser else { - return Color(StyleProvider.color.brandForeground1) // Needs to be lighter? + return Color(StyleProvider.color.brandBackgroundTint) } if messageModel.sendStatus == .failed { return StyleProvider.color.severeBackground1 } else { - return Color(StyleProvider.color.brandBackground1) // ? + return Color(StyleProvider.color.brandBackgroundTint) } } } From 02c51c37e62f0065f714decc0f09127f04ef6026 Mon Sep 17 00:00:00 2001 From: Patrick Latter Date: Mon, 10 Feb 2025 14:47:01 -0800 Subject: [PATCH 7/7] Fix chat colours --- .../Sources/Presentation/Style/ColorThemeProvider.swift | 2 ++ .../Chat/ChatViewComponents/Message/TextMessageView.swift | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift index 7f48a82cb..46e8b2a9e 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/Style/ColorThemeProvider.swift @@ -33,6 +33,7 @@ class ColorThemeProvider { let foregroundDisabled1: Color let stroke2: Color let severeBackground1: Color + let backgroundCanvas: Color init(themeOptions: ThemeOptions?) { self.colorSchemeOverride = themeOptions?.colorSchemeOverride ?? .unspecified @@ -48,6 +49,7 @@ class ColorThemeProvider { self.foregroundDisabled1 = fluentTheme.swiftUIColor(.foregroundDisabled1) // F1: iconDisabled self.stroke2 = fluentTheme.swiftUIColor(.stroke2) // F1: dividerOnPrimary self.severeBackground1 = fluentTheme.swiftUIColor(.severeBackground1) // F1: dangerPrimary? + self.backgroundCanvas = fluentTheme.swiftUIColor(.backgroundCanvas) } private func dynamicColor(light: UIColor, dark: UIColor) -> UIColor { diff --git a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift index 60c7302e4..092f9cd6d 100644 --- a/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift +++ b/AzureCommunicationUI/sdk/AzureCommunicationUIChat/Sources/Presentation/SwiftUI/Chat/ChatViewComponents/Message/TextMessageView.swift @@ -106,7 +106,7 @@ struct TextMessageView: View { private func getMessageBubbleBackground(messageModel: ChatMessageInfoModel) -> Color { guard messageModel.isLocalUser else { - return Color(StyleProvider.color.brandBackgroundTint) + return StyleProvider.color.backgroundCanvas } if messageModel.sendStatus == .failed {