From 0d99facaf8f40c4429074ef02562ee7950ff041e Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Thu, 29 Feb 2024 14:49:10 +0500 Subject: [PATCH 01/21] chore: use custom fonts where missing --- .../Authorization/Presentation/Login/SignInView.swift | 3 +++ .../Presentation/Registration/SignUpView.swift | 1 + .../Presentation/SocialAuth/SocialAuthView.swift | 3 ++- .../Presentation/Startup/StartupView.swift | 1 + Core/Core/View/Base/PickerMenu.swift | 6 +++++- Core/Core/View/Base/RegistrationTextField.swift | 2 ++ .../Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift | 4 ++-- Core/Core/View/Base/SocialAuthButton.swift | 1 + .../DropdownList/CourseUnitDropDownTitle.swift | 2 ++ .../Presentation/Comments/Base/ParentCommentView.swift | 1 + .../CreateNewThread/CreateNewThreadView.swift | 1 + .../DiscussionTopics/DiscussionSearchTopicsView.swift | 1 + .../DiscussionTopics/DiscussionTopicsView.swift | 1 + OpenEdX/View/MainScreenView.swift | 5 +++++ Theme/Theme/SwiftGen/ThemeAssets.swift | 2 +- Theme/Theme/Theme.swift | 10 ++++++++++ 16 files changed, 39 insertions(+), 5 deletions(-) diff --git a/Authorization/Authorization/Presentation/Login/SignInView.swift b/Authorization/Authorization/Presentation/Login/SignInView.swift index 1b63dfabc..6c18775ce 100644 --- a/Authorization/Authorization/Presentation/Login/SignInView.swift +++ b/Authorization/Authorization/Presentation/Login/SignInView.swift @@ -75,6 +75,7 @@ public struct SignInView: View { .foregroundColor(Theme.Colors.textPrimary) .accessibilityIdentifier("username_text") TextField(AuthLocalization.SignIn.emailOrUsername, text: $email) + .font(Theme.Fonts.bodyMedium) .keyboardType(.emailAddress) .textContentType(.emailAddress) .autocapitalization(.none) @@ -97,6 +98,7 @@ public struct SignInView: View { .padding(.top, 18) .accessibilityIdentifier("password_text") SecureField(AuthLocalization.SignIn.password, text: $password) + .font(Theme.Fonts.bodyMedium) .padding(.all, 14) .background( Theme.Shapes.textInputShape @@ -123,6 +125,7 @@ public struct SignInView: View { viewModel.trackForgotPasswordClicked() viewModel.router.showForgotPasswordScreen() } + .font(Theme.Fonts.bodyMedium) .foregroundColor(Theme.Colors.accentColor) .padding(.top, 0) .accessibilityIdentifier("forgot_password_button") diff --git a/Authorization/Authorization/Presentation/Registration/SignUpView.swift b/Authorization/Authorization/Presentation/Registration/SignUpView.swift index 40a851ef3..ca68dc686 100644 --- a/Authorization/Authorization/Presentation/Registration/SignUpView.swift +++ b/Authorization/Authorization/Presentation/Registration/SignUpView.swift @@ -111,6 +111,7 @@ public struct SignUpView: View { Text(disclosureGroupOpen ? AuthLocalization.SignUp.hideFields : AuthLocalization.SignUp.showFields) + .font(Theme.Fonts.labelLarge) } .accessibilityLabel("optional_fields_text") .padding(.top, 10) diff --git a/Authorization/Authorization/Presentation/SocialAuth/SocialAuthView.swift b/Authorization/Authorization/Presentation/SocialAuth/SocialAuthView.swift index f5190cf4e..6a14f8d39 100644 --- a/Authorization/Authorization/Presentation/SocialAuth/SocialAuthView.swift +++ b/Authorization/Authorization/Presentation/SocialAuth/SocialAuthView.swift @@ -7,6 +7,7 @@ import SwiftUI import Core +import Theme struct SocialAuthView: View { @@ -51,7 +52,7 @@ struct SocialAuthView: View { HStack { Text("\(AuthLocalization.or) \(title.lowercased()):") .padding(.vertical, 20) - .font(.system(size: 17, weight: .medium)) + .font(Theme.Fonts.labelLarge) .accessibilityIdentifier("social_auth_title_text") Spacer() } diff --git a/Authorization/Authorization/Presentation/Startup/StartupView.swift b/Authorization/Authorization/Presentation/Startup/StartupView.swift index db0eff655..d5fdca04d 100644 --- a/Authorization/Authorization/Presentation/Startup/StartupView.swift +++ b/Authorization/Authorization/Presentation/Startup/StartupView.swift @@ -66,6 +66,7 @@ public struct StartupView: View { .autocorrectionDisabled() .frame(minHeight: 50) .submitLabel(.search) + .font(Theme.Fonts.bodyMedium) .accessibilityIdentifier("explore_courses_textfield") }.overlay( diff --git a/Core/Core/View/Base/PickerMenu.swift b/Core/Core/View/Base/PickerMenu.swift index 849f99ae4..2066a8aa0 100644 --- a/Core/Core/View/Base/PickerMenu.swift +++ b/Core/Core/View/Base/PickerMenu.swift @@ -82,20 +82,23 @@ public struct PickerMenu: View { Text(titleText) .foregroundColor(Theme.Colors.textPrimary) .accessibilityIdentifier("picker_title_text") + .font(Theme.Fonts.bodyMedium) TextField(CoreLocalization.Picker.search, text: $search) .padding(.all, 8) + .font(Theme.Fonts.bodySmall) .background(Theme.Colors.textInputStroke.cornerRadius(6)) .accessibilityIdentifier("picker_search_textfield") Picker("", selection: $selectedItem) { ForEach(filteredItems, id: \.self) { item in Text(item.value) .foregroundColor(Theme.Colors.textPrimary) + .font(Theme.Fonts.bodyMedium) } } .pickerStyle(.wheel) .accessibilityIdentifier("picker") } - .frame(minWidth: 0, + .frame(minWidth: 0, maxWidth: (idiom == .pad || (idiom == .phone && isHorizontal)) ? ipadPickerWidth : .infinity) @@ -114,6 +117,7 @@ public struct PickerMenu: View { router.dismiss(animated: true) }) { Text(CoreLocalization.Picker.accept) + .font(Theme.Fonts.bodyMedium) .foregroundColor(Theme.Colors.textPrimary) .frame(minWidth: 0, maxWidth: (idiom == .pad || (idiom == .phone && isHorizontal)) diff --git a/Core/Core/View/Base/RegistrationTextField.swift b/Core/Core/View/Base/RegistrationTextField.swift index 70467643f..b2e8ffcb0 100644 --- a/Core/Core/View/Base/RegistrationTextField.swift +++ b/Core/Core/View/Base/RegistrationTextField.swift @@ -42,6 +42,7 @@ public struct RegistrationTextField: View { } if isTextArea { TextEditor(text: $config.text) + .font(Theme.Fonts.bodyMedium) .padding(.horizontal, 12) .padding(.vertical, 4) .frame(height: 100) @@ -87,6 +88,7 @@ public struct RegistrationTextField: View { .accessibilityIdentifier("\(config.field.name)_textfield") } else { TextField(placeholder, text: $config.text) + .font(Theme.Fonts.bodyMedium) .keyboardType(keyboardType) .textContentType(textContentType) .autocapitalization(.none) diff --git a/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift b/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift index 0c89f0811..1408b5248 100644 --- a/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift +++ b/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift @@ -160,8 +160,8 @@ extension ScrollSlidingTabBar { } public static let `default` = Style( - font: .body, - selectedFont: .body.bold(), + font: Theme.Fonts.bodyMedium, + selectedFont: Theme.Fonts.titleSmall, activeAccentColor: Theme.Colors.accentColor, inactiveAccentColor: Theme.Colors.textSecondary, indicatorHeight: 2, diff --git a/Core/Core/View/Base/SocialAuthButton.swift b/Core/Core/View/Base/SocialAuthButton.swift index 3ebd367e7..22f4f25dc 100644 --- a/Core/Core/View/Base/SocialAuthButton.swift +++ b/Core/Core/View/Base/SocialAuthButton.swift @@ -47,6 +47,7 @@ public struct SocialAuthButton: View { Text(title) .foregroundStyle(textColor) .padding(.leading, 10) + .font(Theme.Fonts.bodyMedium) Spacer() } icon: { image.padding(.leading, 10) diff --git a/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownTitle.swift b/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownTitle.swift index 79b1e193f..13c31d3a4 100644 --- a/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownTitle.swift +++ b/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownTitle.swift @@ -6,6 +6,7 @@ // import SwiftUI +import Theme struct CourseUnitDropDownTitle: View { var title: String @@ -23,6 +24,7 @@ struct CourseUnitDropDownTitle: View { Text(title) .opacity(showDropdown ? 0.7 : 1.0) .lineLimit(1) + .font(Theme.Fonts.bodySmall) if isAvailable { Image(systemName: "chevron.down") .dropdownArrowRotationAnimation(value: showDropdown) diff --git a/Discussion/Discussion/Presentation/Comments/Base/ParentCommentView.swift b/Discussion/Discussion/Presentation/Comments/Base/ParentCommentView.swift index 15ced3ce7..1168f91a5 100644 --- a/Discussion/Discussion/Presentation/Comments/Base/ParentCommentView.swift +++ b/Discussion/Discussion/Presentation/Comments/Base/ParentCommentView.swift @@ -67,6 +67,7 @@ public struct ParentCommentView: View { Text(comments.followed ? DiscussionLocalization.Comment.unfollow : DiscussionLocalization.Comment.follow) + .font(Theme.Fonts.bodyMedium) }).foregroundColor(comments.followed ? Theme.Colors.accentColor : Theme.Colors.textSecondary) diff --git a/Discussion/Discussion/Presentation/CreateNewThread/CreateNewThreadView.swift b/Discussion/Discussion/Presentation/CreateNewThread/CreateNewThreadView.swift index f6f6a0dc4..265494791 100644 --- a/Discussion/Discussion/Presentation/CreateNewThread/CreateNewThreadView.swift +++ b/Discussion/Discussion/Presentation/CreateNewThread/CreateNewThreadView.swift @@ -65,6 +65,7 @@ public struct CreateNewThreadView: View { Picker("", selection: $postType) { ForEach(postTypes, id: \.self) { Text($0.localizedValue.capitalized) + .font(Theme.Fonts.bodySmall) } }.pickerStyle(.segmented) .frame(maxWidth: .infinity, maxHeight: 40) diff --git a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionSearchTopicsView.swift b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionSearchTopicsView.swift index 8091016fe..637f057be 100644 --- a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionSearchTopicsView.swift +++ b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionSearchTopicsView.swift @@ -52,6 +52,7 @@ public struct DiscussionSearchTopicsView: View { self.focused = true } .foregroundColor(Theme.Colors.textPrimary) + .font(Theme.Fonts.bodyMedium) Spacer() if !viewModel.searchText.trimmingCharacters(in: .whitespaces).isEmpty { Button(action: { viewModel.searchText.removeAll() }, label: { diff --git a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift index e242b58d9..dcff23388 100644 --- a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift +++ b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift @@ -32,6 +32,7 @@ public struct DiscussionTopicsView: View { .padding(.top, 1) Text(DiscussionLocalization.Topics.search) .foregroundColor(Theme.Colors.textSecondary) + .font(Theme.Fonts.bodyMedium) Spacer() } .frame(maxWidth: 532) diff --git a/OpenEdX/View/MainScreenView.swift b/OpenEdX/View/MainScreenView.swift index 8971d982c..175b715e4 100644 --- a/OpenEdX/View/MainScreenView.swift +++ b/OpenEdX/View/MainScreenView.swift @@ -37,6 +37,11 @@ struct MainScreenView: View { UITabBar.appearance().barTintColor = UIColor(Theme.Colors.textInputUnfocusedBackground) UITabBar.appearance().backgroundColor = UIColor(Theme.Colors.textInputUnfocusedBackground) UITabBar.appearance().unselectedItemTintColor = UIColor(Theme.Colors.textSecondaryLight) + + UITabBarItem.appearance().setTitleTextAttributes( + [NSAttributedString.Key.font: Theme.UIFonts.labelSmall()], + for: .normal + ) } var body: some View { diff --git a/Theme/Theme/SwiftGen/ThemeAssets.swift b/Theme/Theme/SwiftGen/ThemeAssets.swift index 09afbbb6b..19d67ddf2 100644 --- a/Theme/Theme/SwiftGen/ThemeAssets.swift +++ b/Theme/Theme/SwiftGen/ThemeAssets.swift @@ -38,6 +38,7 @@ public enum ThemeAssets { public static let commentCellBackground = ColorAsset(name: "CommentCellBackground") public static let loginBackground = ColorAsset(name: "LoginBackground") public static let loginNavigationText = ColorAsset(name: "LoginNavigationText") + public static let secondaryButtonBorderColor = ColorAsset(name: "SecondaryButtonBorderColor") public static let secondaryButtonTextColor = ColorAsset(name: "SecondaryButtonTextColor") public static let shadowColor = ColorAsset(name: "ShadowColor") public static let snackbarErrorColor = ColorAsset(name: "SnackbarErrorColor") @@ -55,7 +56,6 @@ public enum ThemeAssets { public static let textInputUnfocusedBackground = ColorAsset(name: "TextInputUnfocusedBackground") public static let textInputUnfocusedStroke = ColorAsset(name: "TextInputUnfocusedStroke") public static let navigationBarTintColor = ColorAsset(name: "navigationBarTintColor") - public static let secondaryButtonBorderColor = ColorAsset(name: "secondaryButtonBorderColor") public static let warning = ColorAsset(name: "warning") public static let white = ColorAsset(name: "white") public static let datesSectionBackground = ColorAsset(name: "DatesSectionBackground") diff --git a/Theme/Theme/Theme.swift b/Theme/Theme/Theme.swift index ec48bcad6..6d0a9f459 100644 --- a/Theme/Theme/Theme.swift +++ b/Theme/Theme/Theme.swift @@ -181,6 +181,16 @@ public struct Theme { public static let labelSmall: Font = .custom(fontsParser.fontName(for: .regular), size: 10) } + public struct UIFonts { + public static func labelSmall() -> UIFont { + guard let font = UIFont(name: fontsParser.fontName(for: .regular), size: 10) else { + assert(false, "Could not find the required font") + } + + return font + } + } + public struct Shapes { public static var isRoundedCorners: Bool = true public static let screenBackgroundRadius = 24.0 From 633a3158ea8a106b2ad410c2d2127a25e870ffe5 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Thu, 29 Feb 2024 14:53:20 +0500 Subject: [PATCH 02/21] refactor: add light logo as universal image as its a svg --- .../appLogoLight.imageset/Contents.json | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Theme/Theme/Assets.xcassets/appLogoLight.imageset/Contents.json b/Theme/Theme/Assets.xcassets/appLogoLight.imageset/Contents.json index 0c3881647..7443b6fbe 100644 --- a/Theme/Theme/Assets.xcassets/appLogoLight.imageset/Contents.json +++ b/Theme/Theme/Assets.xcassets/appLogoLight.imageset/Contents.json @@ -1,17 +1,8 @@ { "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, { "filename" : "appLogoWhite.svg", - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" + "idiom" : "universal" } ], "info" : { From 04239ca35de78ad05b0f96d45c6ebe487632daca Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Thu, 29 Feb 2024 15:11:22 +0500 Subject: [PATCH 03/21] refactor: moving colors inside under folder Colors --- .../Theme/Assets.xcassets/{ => Colors}/CourseDates/Contents.json | 0 .../CourseDates/DatesSectionBackground.colorset/Contents.json | 0 .../CourseDates/DatesSectionStroke.colorset/Contents.json | 0 .../CourseDates/NextWeekTimelineColor.colorset/Contents.json | 0 .../CourseDates/ThisWeekTimelineColor.colorset/Contents.json | 0 .../CourseDates/TodayTimelineColor.colorset/Contents.json | 0 .../CourseDates/UpcomingTimelineColor.colorset/Contents.json | 0 .../CourseDates/pastDueTimelineColor.colorset/Contents.json | 0 .../Theme/Assets.xcassets/{ => Colors}/ProgressLine/Contents.json | 0 .../{ => Colors}/ProgressLine/OnProgress.colorset/Contents.json | 0 .../{ => Colors}/ProgressLine/ProgressDone.colorset/Contents.json | 0 .../{ => Colors}/ProgressLine/ProgressSkip.colorset/Contents.json | 0 .../ProgressLine/SelectedAndDone.colorset/Contents.json | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename Theme/Theme/Assets.xcassets/{ => Colors}/CourseDates/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/CourseDates/DatesSectionBackground.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/CourseDates/DatesSectionStroke.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/CourseDates/NextWeekTimelineColor.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/CourseDates/ThisWeekTimelineColor.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/CourseDates/TodayTimelineColor.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/CourseDates/UpcomingTimelineColor.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/CourseDates/pastDueTimelineColor.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/ProgressLine/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/ProgressLine/OnProgress.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/ProgressLine/ProgressDone.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/ProgressLine/ProgressSkip.colorset/Contents.json (100%) rename Theme/Theme/Assets.xcassets/{ => Colors}/ProgressLine/SelectedAndDone.colorset/Contents.json (100%) diff --git a/Theme/Theme/Assets.xcassets/CourseDates/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseDates/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/CourseDates/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseDates/Contents.json diff --git a/Theme/Theme/Assets.xcassets/CourseDates/DatesSectionBackground.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseDates/DatesSectionBackground.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/CourseDates/DatesSectionBackground.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseDates/DatesSectionBackground.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/CourseDates/DatesSectionStroke.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseDates/DatesSectionStroke.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/CourseDates/DatesSectionStroke.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseDates/DatesSectionStroke.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/CourseDates/NextWeekTimelineColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseDates/NextWeekTimelineColor.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/CourseDates/NextWeekTimelineColor.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseDates/NextWeekTimelineColor.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/CourseDates/ThisWeekTimelineColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseDates/ThisWeekTimelineColor.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/CourseDates/ThisWeekTimelineColor.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseDates/ThisWeekTimelineColor.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/CourseDates/TodayTimelineColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseDates/TodayTimelineColor.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/CourseDates/TodayTimelineColor.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseDates/TodayTimelineColor.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/CourseDates/UpcomingTimelineColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseDates/UpcomingTimelineColor.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/CourseDates/UpcomingTimelineColor.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseDates/UpcomingTimelineColor.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/CourseDates/pastDueTimelineColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/CourseDates/pastDueTimelineColor.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/CourseDates/pastDueTimelineColor.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/CourseDates/pastDueTimelineColor.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/ProgressLine/Contents.json b/Theme/Theme/Assets.xcassets/Colors/ProgressLine/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/ProgressLine/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/ProgressLine/Contents.json diff --git a/Theme/Theme/Assets.xcassets/ProgressLine/OnProgress.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/ProgressLine/OnProgress.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/ProgressLine/OnProgress.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/ProgressLine/OnProgress.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/ProgressLine/ProgressDone.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/ProgressLine/ProgressDone.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/ProgressLine/ProgressDone.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/ProgressLine/ProgressDone.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/ProgressLine/ProgressSkip.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/ProgressLine/ProgressSkip.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/ProgressLine/ProgressSkip.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/ProgressLine/ProgressSkip.colorset/Contents.json diff --git a/Theme/Theme/Assets.xcassets/ProgressLine/SelectedAndDone.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/ProgressLine/SelectedAndDone.colorset/Contents.json similarity index 100% rename from Theme/Theme/Assets.xcassets/ProgressLine/SelectedAndDone.colorset/Contents.json rename to Theme/Theme/Assets.xcassets/Colors/ProgressLine/SelectedAndDone.colorset/Contents.json From eda0293aadda5ced3a6b72bbf548bef149034948 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Thu, 29 Feb 2024 17:53:02 +0500 Subject: [PATCH 04/21] chore: use custom font for navigation bar title and segment control --- .../Extensions/UIApplicationExtension.swift | 13 ++++++++++- Theme/Theme/SwiftGen/ThemeAssets.swift | 22 +++++++++---------- Theme/Theme/Theme.swift | 16 ++++++++++++++ 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/Core/Core/Extensions/UIApplicationExtension.swift b/Core/Core/Extensions/UIApplicationExtension.swift index 871a60b7b..cb3dc37ca 100644 --- a/Core/Core/Extensions/UIApplicationExtension.swift +++ b/Core/Core/Extensions/UIApplicationExtension.swift @@ -48,7 +48,18 @@ extension UINavigationController { navigationBar.backIndicatorImage = image.withTintColor(Theme.UIColors.accentXColor) navigationBar.backItem?.backButtonTitle = " " navigationBar.backIndicatorTransitionMaskImage = image.withTintColor(Theme.UIColors.accentXColor) - navigationBar.titleTextAttributes = [.foregroundColor: Theme.UIColors.navigationBarTintColor] + navigationBar.titleTextAttributes = [ + .foregroundColor: Theme.UIColors.navigationBarTintColor, + .font: Theme.UIFonts.titleMedium() + ] + + UISegmentedControl.appearance().setTitleTextAttributes( + [ + .foregroundColor: Theme.Colors.white.uiColor(), + .font: Theme.UIFonts.labelLarge() + ], + for: .normal) + UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = Theme.UIColors.accentColor } } diff --git a/Theme/Theme/SwiftGen/ThemeAssets.swift b/Theme/Theme/SwiftGen/ThemeAssets.swift index 19d67ddf2..8d352f649 100644 --- a/Theme/Theme/SwiftGen/ThemeAssets.swift +++ b/Theme/Theme/SwiftGen/ThemeAssets.swift @@ -36,8 +36,19 @@ public enum ThemeAssets { public static let cardViewStroke = ColorAsset(name: "CardViewStroke") public static let certificateForeground = ColorAsset(name: "CertificateForeground") public static let commentCellBackground = ColorAsset(name: "CommentCellBackground") + public static let datesSectionBackground = ColorAsset(name: "DatesSectionBackground") + public static let datesSectionStroke = ColorAsset(name: "DatesSectionStroke") + public static let nextWeekTimelineColor = ColorAsset(name: "NextWeekTimelineColor") + public static let thisWeekTimelineColor = ColorAsset(name: "ThisWeekTimelineColor") + public static let todayTimelineColor = ColorAsset(name: "TodayTimelineColor") + public static let upcomingTimelineColor = ColorAsset(name: "UpcomingTimelineColor") + public static let pastDueTimelineColor = ColorAsset(name: "pastDueTimelineColor") public static let loginBackground = ColorAsset(name: "LoginBackground") public static let loginNavigationText = ColorAsset(name: "LoginNavigationText") + public static let onProgress = ColorAsset(name: "OnProgress") + public static let progressDone = ColorAsset(name: "ProgressDone") + public static let progressSkip = ColorAsset(name: "ProgressSkip") + public static let selectedAndDone = ColorAsset(name: "SelectedAndDone") public static let secondaryButtonBorderColor = ColorAsset(name: "SecondaryButtonBorderColor") public static let secondaryButtonTextColor = ColorAsset(name: "SecondaryButtonTextColor") public static let shadowColor = ColorAsset(name: "ShadowColor") @@ -58,17 +69,6 @@ public enum ThemeAssets { public static let navigationBarTintColor = ColorAsset(name: "navigationBarTintColor") public static let warning = ColorAsset(name: "warning") public static let white = ColorAsset(name: "white") - public static let datesSectionBackground = ColorAsset(name: "DatesSectionBackground") - public static let datesSectionStroke = ColorAsset(name: "DatesSectionStroke") - public static let nextWeekTimelineColor = ColorAsset(name: "NextWeekTimelineColor") - public static let thisWeekTimelineColor = ColorAsset(name: "ThisWeekTimelineColor") - public static let todayTimelineColor = ColorAsset(name: "TodayTimelineColor") - public static let upcomingTimelineColor = ColorAsset(name: "UpcomingTimelineColor") - public static let pastDueTimelineColor = ColorAsset(name: "pastDueTimelineColor") - public static let onProgress = ColorAsset(name: "OnProgress") - public static let progressDone = ColorAsset(name: "ProgressDone") - public static let progressSkip = ColorAsset(name: "ProgressSkip") - public static let selectedAndDone = ColorAsset(name: "SelectedAndDone") public static let appLogo = ImageAsset(name: "appLogo") public static let appLogoLight = ImageAsset(name: "appLogoLight") } diff --git a/Theme/Theme/Theme.swift b/Theme/Theme/Theme.swift index 6d0a9f459..75110db9a 100644 --- a/Theme/Theme/Theme.swift +++ b/Theme/Theme/Theme.swift @@ -189,6 +189,22 @@ public struct Theme { return font } + + public static func labelLarge() -> UIFont { + guard let font = UIFont(name: fontsParser.fontName(for: .regular), size: 14) else { + assert(false, "Could not find the required font") + } + + return font + } + + public static func titleMedium() -> UIFont { + guard let font = UIFont(name: fontsParser.fontName(for: .semiBold), size: 18) else { + assert(false, "Could not find the required font") + } + + return font + } } public struct Shapes { From 93ca6a28034a1d3b565179252ff6107db24e0643 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Fri, 1 Mar 2024 10:39:46 +0500 Subject: [PATCH 05/21] refactor: color combination improvements --- Authorization/Authorization/Presentation/Base/FieldsView.swift | 2 +- Authorization/Authorization/Presentation/Login/SignInView.swift | 2 +- Core/Core/View/Base/PickerMenu.swift | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Authorization/Authorization/Presentation/Base/FieldsView.swift b/Authorization/Authorization/Presentation/Base/FieldsView.swift index d05eac80f..0bc9f2ea2 100644 --- a/Authorization/Authorization/Presentation/Base/FieldsView.swift +++ b/Authorization/Authorization/Presentation/Base/FieldsView.swift @@ -95,7 +95,7 @@ struct FieldsView: View { } Text(.init(text)) .tint(Theme.Colors.accentXColor) - .foregroundStyle(Theme.Colors.textSecondaryLight) + .foregroundStyle(Theme.Colors.textSecondary) .font(Theme.Fonts.labelSmall) .padding(.vertical, 3) .id(UUID()) diff --git a/Authorization/Authorization/Presentation/Login/SignInView.swift b/Authorization/Authorization/Presentation/Login/SignInView.swift index 6c18775ce..3081fc784 100644 --- a/Authorization/Authorization/Presentation/Login/SignInView.swift +++ b/Authorization/Authorization/Presentation/Login/SignInView.swift @@ -219,7 +219,7 @@ public struct SignInView: View { ) Text(.init(text)) .tint(Theme.Colors.accentXColor) - .foregroundStyle(Theme.Colors.textSecondaryLight) + .foregroundStyle(Theme.Colors.textSecondary) .font(Theme.Fonts.labelSmall) .padding(.top, viewModel.socialAuthEnabled ? 0 : 15) .padding(.bottom, 15) diff --git a/Core/Core/View/Base/PickerMenu.swift b/Core/Core/View/Base/PickerMenu.swift index 2066a8aa0..9bacdbe65 100644 --- a/Core/Core/View/Base/PickerMenu.swift +++ b/Core/Core/View/Base/PickerMenu.swift @@ -88,6 +88,7 @@ public struct PickerMenu: View { .font(Theme.Fonts.bodySmall) .background(Theme.Colors.textInputStroke.cornerRadius(6)) .accessibilityIdentifier("picker_search_textfield") + .foregroundColor(Theme.Colors.textPrimary) Picker("", selection: $selectedItem) { ForEach(filteredItems, id: \.self) { item in Text(item.value) From 1a7564410e32c7c0b0b545901898d4b7ba969b18 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Fri, 1 Mar 2024 15:23:30 +0500 Subject: [PATCH 06/21] chore: using custom color and font across the app for more elements --- .../Presentation/Base/FieldsView.swift | 2 +- .../Presentation/Login/SignInView.swift | 8 +++++--- .../Reset Password/ResetPasswordView.swift | 2 ++ .../Presentation/Startup/StartupView.swift | 4 +++- .../Extensions/UIApplicationExtension.swift | 1 + Core/Core/View/Base/AlertView.swift | 14 +++++++++++--- .../View/Base/AppReview/AppReviewView.swift | 2 ++ Core/Core/View/Base/CheckBoxView.swift | 1 + Core/Core/View/Base/PickerView.swift | 4 ++-- Core/Core/View/Base/RegistrationTextField.swift | 14 ++++++++------ .../ScrollSlidingTabBar.swift | 4 ++-- Core/Core/View/Base/UnitButtonView.swift | 4 ++-- .../DropdownList/CourseUnitDropDownTitle.swift | 6 ++++-- .../NativeDiscovery/DiscoveryView.swift | 1 + .../NativeDiscovery/SearchView.swift | 2 ++ .../Domain/Model/DiscussionPost.swift | 4 ++-- .../Comments/Base/CommentCell.swift | 10 ++++++---- .../Comments/Base/ParentCommentView.swift | 17 +++++++++++------ .../Comments/Responses/ResponsesView.swift | 12 +++++++----- .../Comments/Thread/ThreadView.swift | 12 +++++++----- .../CreateNewThread/CreateNewThreadView.swift | 16 ++++++++++------ .../DiscussionSearchTopicsView.swift | 1 + .../DiscussionTopics/DiscussionTopicsView.swift | 9 +++++++-- .../Presentation/Posts/PostsView.swift | 1 + .../EditProfile/EditProfileView.swift | 2 ++ .../Presentation/Profile/ProfileView.swift | 1 + .../Subviews/ProfileSupportInfoView.swift | 4 ++++ 27 files changed, 106 insertions(+), 52 deletions(-) diff --git a/Authorization/Authorization/Presentation/Base/FieldsView.swift b/Authorization/Authorization/Presentation/Base/FieldsView.swift index 0bc9f2ea2..d05eac80f 100644 --- a/Authorization/Authorization/Presentation/Base/FieldsView.swift +++ b/Authorization/Authorization/Presentation/Base/FieldsView.swift @@ -95,7 +95,7 @@ struct FieldsView: View { } Text(.init(text)) .tint(Theme.Colors.accentXColor) - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.textSecondaryLight) .font(Theme.Fonts.labelSmall) .padding(.vertical, 3) .id(UUID()) diff --git a/Authorization/Authorization/Presentation/Login/SignInView.swift b/Authorization/Authorization/Presentation/Login/SignInView.swift index 3081fc784..828c89bb1 100644 --- a/Authorization/Authorization/Presentation/Login/SignInView.swift +++ b/Authorization/Authorization/Presentation/Login/SignInView.swift @@ -75,7 +75,8 @@ public struct SignInView: View { .foregroundColor(Theme.Colors.textPrimary) .accessibilityIdentifier("username_text") TextField(AuthLocalization.SignIn.emailOrUsername, text: $email) - .font(Theme.Fonts.bodyMedium) + .font(Theme.Fonts.bodyLarge) + .foregroundColor(Theme.Colors.textPrimary) .keyboardType(.emailAddress) .textContentType(.emailAddress) .autocapitalization(.none) @@ -98,7 +99,8 @@ public struct SignInView: View { .padding(.top, 18) .accessibilityIdentifier("password_text") SecureField(AuthLocalization.SignIn.password, text: $password) - .font(Theme.Fonts.bodyMedium) + .font(Theme.Fonts.bodyLarge) + .foregroundColor(Theme.Colors.textPrimary) .padding(.all, 14) .background( Theme.Shapes.textInputShape @@ -219,7 +221,7 @@ public struct SignInView: View { ) Text(.init(text)) .tint(Theme.Colors.accentXColor) - .foregroundStyle(Theme.Colors.textSecondary) + .foregroundStyle(Theme.Colors.textSecondaryLight) .font(Theme.Fonts.labelSmall) .padding(.top, viewModel.socialAuthEnabled ? 0 : 15) .padding(.bottom, 15) diff --git a/Authorization/Authorization/Presentation/Reset Password/ResetPasswordView.swift b/Authorization/Authorization/Presentation/Reset Password/ResetPasswordView.swift index 3cec56f4a..6b375a75b 100644 --- a/Authorization/Authorization/Presentation/Reset Password/ResetPasswordView.swift +++ b/Authorization/Authorization/Presentation/Reset Password/ResetPasswordView.swift @@ -92,6 +92,8 @@ public struct ResetPasswordView: View { .foregroundColor(Theme.Colors.textPrimary) .accessibilityIdentifier("email_text") TextField(AuthLocalization.SignIn.email, text: $email) + .font(Theme.Fonts.bodyLarge) + .foregroundColor(Theme.Colors.textPrimary) .keyboardType(.emailAddress) .textContentType(.emailAddress) .autocapitalization(.none) diff --git a/Authorization/Authorization/Presentation/Startup/StartupView.swift b/Authorization/Authorization/Presentation/Startup/StartupView.swift index d5fdca04d..d68e97c62 100644 --- a/Authorization/Authorization/Presentation/Startup/StartupView.swift +++ b/Authorization/Authorization/Presentation/Startup/StartupView.swift @@ -55,6 +55,7 @@ public struct StartupView: View { Image(systemName: "magnifyingglass") .padding(.leading, 16) .padding(.top, 1) + .foregroundColor(Theme.Colors.textPrimary) TextField(AuthLocalization.Startup.searchPlaceholder, text: $searchQuery, onCommit: { if searchQuery.isEmpty { return } viewModel.router.showDiscoveryScreen( @@ -66,7 +67,8 @@ public struct StartupView: View { .autocorrectionDisabled() .frame(minHeight: 50) .submitLabel(.search) - .font(Theme.Fonts.bodyMedium) + .font(Theme.Fonts.bodyLarge) + .foregroundColor(Theme.Colors.textPrimary) .accessibilityIdentifier("explore_courses_textfield") }.overlay( diff --git a/Core/Core/Extensions/UIApplicationExtension.swift b/Core/Core/Extensions/UIApplicationExtension.swift index cb3dc37ca..39dfa7692 100644 --- a/Core/Core/Extensions/UIApplicationExtension.swift +++ b/Core/Core/Extensions/UIApplicationExtension.swift @@ -59,6 +59,7 @@ extension UINavigationController { .font: Theme.UIFonts.labelLarge() ], for: .normal) + UISegmentedControl.appearance().selectedSegmentTintColor = UIColor(Theme.Colors.accentColor) UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = Theme.UIColors.accentColor } diff --git a/Core/Core/View/Base/AlertView.swift b/Core/Core/View/Base/AlertView.swift index 80aa89307..021cd6dac 100644 --- a/Core/Core/View/Base/AlertView.swift +++ b/Core/Core/View/Base/AlertView.swift @@ -134,12 +134,14 @@ public struct AlertView: View { case .logOut: HStack { Spacer(minLength: 100) - CoreAssets.logOut.swiftUIImage + CoreAssets.logOut.swiftUIImage.renderingMode(.template) .padding(.top, isHorizontal ? 20 : 54) + .foregroundColor(Theme.Colors.textPrimary) Spacer(minLength: 100) } Text(alertMessage) .font(Theme.Fonts.titleLarge) + .foregroundColor(Theme.Colors.textPrimary) .padding(.vertical, isHorizontal ? 6 : 40) .multilineTextAlignment(.center) .padding(.horizontal, 40) @@ -147,17 +149,21 @@ public struct AlertView: View { case .leaveProfile, .deleteVideo: VStack(spacing: 20) { if type == .deleteVideo { - CoreAssets.warning.swiftUIImage + CoreAssets.warning.swiftUIImage.renderingMode(.template) + .foregroundColor(Theme.Colors.textPrimary) .padding(.top, isHorizontal ? 20 : 54) } else { - CoreAssets.leaveProfile.swiftUIImage + CoreAssets.leaveProfile.swiftUIImage.renderingMode(.template) + .foregroundColor(Theme.Colors.textPrimary) .padding(.top, isHorizontal ? 20 : 54) } Text(alertTitle) .font(Theme.Fonts.titleLarge) + .foregroundColor(Theme.Colors.textPrimary) .padding(.horizontal, 40) Text(alertMessage) .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) .multilineTextAlignment(.center) .padding(.horizontal, 40) @@ -174,10 +180,12 @@ public struct AlertView: View { } Text(alertTitle) .font(Theme.Fonts.titleLarge) + .foregroundColor(Theme.Colors.textPrimary) .padding(.horizontal, 40) .padding(.top, 10) Text(alertMessage) .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) .multilineTextAlignment(.center) .padding(.horizontal, 40) .frame(maxWidth: 250) diff --git a/Core/Core/View/Base/AppReview/AppReviewView.swift b/Core/Core/View/Base/AppReview/AppReviewView.swift index e7fedcf1b..c22765245 100644 --- a/Core/Core/View/Base/AppReview/AppReviewView.swift +++ b/Core/Core/View/Base/AppReview/AppReviewView.swift @@ -68,6 +68,8 @@ public struct AppReviewView: View { case .feedback: TextEditor(text: $viewModel.feedback) + .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) .padding(.horizontal, 12) .padding(.vertical, 4) .hideScrollContentBackground() diff --git a/Core/Core/View/Base/CheckBoxView.swift b/Core/Core/View/Base/CheckBoxView.swift index 29253290a..a900d292a 100644 --- a/Core/Core/View/Base/CheckBoxView.swift +++ b/Core/Core/View/Base/CheckBoxView.swift @@ -30,6 +30,7 @@ public struct CheckBoxView: View { ) Text(text) .font(font) + .foregroundColor(Theme.Colors.textPrimary) } .onTapGesture { withAnimation(.linear(duration: 0.1)) { diff --git a/Core/Core/View/Base/PickerView.swift b/Core/Core/View/Base/PickerView.swift index c7437ac71..91be4684b 100644 --- a/Core/Core/View/Base/PickerView.swift +++ b/Core/Core/View/Base/PickerView.swift @@ -61,7 +61,7 @@ public struct PickerView: View { .stroke(lineWidth: 1) .fill(config.error == "" ? Theme.Colors.textInputStroke - : Color.red) + : Theme.Colors.alert) ) .shake($config.shake) Text(config.error == "" ? config.field.instructions @@ -69,7 +69,7 @@ public struct PickerView: View { .font(Theme.Fonts.labelMedium) .foregroundColor(config.error == "" ? Theme.Colors.textPrimary - : Color.red) + : Theme.Colors.alert) .accessibilityIdentifier("\(config.field.name)_instructions_text") } } diff --git a/Core/Core/View/Base/RegistrationTextField.swift b/Core/Core/View/Base/RegistrationTextField.swift index b2e8ffcb0..a6751451b 100644 --- a/Core/Core/View/Base/RegistrationTextField.swift +++ b/Core/Core/View/Base/RegistrationTextField.swift @@ -43,6 +43,7 @@ public struct RegistrationTextField: View { if isTextArea { TextEditor(text: $config.text) .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) .padding(.horizontal, 12) .padding(.vertical, 4) .frame(height: 100) @@ -58,7 +59,7 @@ public struct RegistrationTextField: View { .fill( config.error == "" ? Theme.Colors.textInputStroke - : Color.red + : Theme.Colors.alert ) ) .shake($config.shake) @@ -81,14 +82,15 @@ public struct RegistrationTextField: View { .fill( config.error == "" ? Theme.Colors.textInputStroke - : Color.red + : Theme.Colors.alert ) ) .shake($config.shake) .accessibilityIdentifier("\(config.field.name)_textfield") } else { TextField(placeholder, text: $config.text) - .font(Theme.Fonts.bodyMedium) + .font(Theme.Fonts.bodyLarge) + .foregroundColor(Theme.Colors.textPrimary) .keyboardType(keyboardType) .textContentType(textContentType) .autocapitalization(.none) @@ -104,7 +106,7 @@ public struct RegistrationTextField: View { .fill( config.error == "" ? Theme.Colors.textInputStroke - : Color.red + : Theme.Colors.alert ) ) .shake($config.shake) @@ -115,8 +117,8 @@ public struct RegistrationTextField: View { Text(config.error == "" ? config.field.instructions : config.error) .font(Theme.Fonts.bodySmall) .foregroundColor(config.error == "" - ? Theme.Colors.textSecondary - : Color.red) + ? Theme.Colors.textSecondaryLight + : Theme.Colors.alert) .accessibilityIdentifier("\(config.field.name)_instructions_text") } } diff --git a/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift b/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift index 1408b5248..29401776f 100644 --- a/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift +++ b/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift @@ -160,8 +160,8 @@ extension ScrollSlidingTabBar { } public static let `default` = Style( - font: Theme.Fonts.bodyMedium, - selectedFont: Theme.Fonts.titleSmall, + font: Theme.Fonts.bodyLarge, + selectedFont: Theme.Fonts.titleMedium, activeAccentColor: Theme.Colors.accentColor, inactiveAccentColor: Theme.Colors.textSecondary, indicatorHeight: 2, diff --git a/Core/Core/View/Base/UnitButtonView.swift b/Core/Core/View/Base/UnitButtonView.swift index 5dfc96775..6e39ff997 100644 --- a/Core/Core/View/Base/UnitButtonView.swift +++ b/Core/Core/View/Base/UnitButtonView.swift @@ -109,9 +109,9 @@ public struct UnitButtonView: View { } else { CoreAssets.arrowLeft.swiftUIImage.renderingMode(.template) .padding(.leading, 20) - .foregroundColor(Theme.Colors.accentColor) + .foregroundColor(Theme.Colors.secondaryButtonTextColor) Text(type.stringValue()) - .foregroundColor(Theme.Colors.accentColor) + .foregroundColor(Theme.Colors.secondaryButtonTextColor) .font(Theme.Fonts.labelLarge) .padding(.trailing, 20) } diff --git a/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownTitle.swift b/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownTitle.swift index 13c31d3a4..93a666bcc 100644 --- a/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownTitle.swift +++ b/Course/Course/Presentation/Unit/Subviews/DropdownList/CourseUnitDropDownTitle.swift @@ -24,10 +24,12 @@ struct CourseUnitDropDownTitle: View { Text(title) .opacity(showDropdown ? 0.7 : 1.0) .lineLimit(1) - .font(Theme.Fonts.bodySmall) + .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) if isAvailable { - Image(systemName: "chevron.down") + Image(systemName: "chevron.down").renderingMode(.template) .dropdownArrowRotationAnimation(value: showDropdown) + .foregroundColor(Theme.Colors.textPrimary) } } } diff --git a/Discovery/Discovery/Presentation/NativeDiscovery/DiscoveryView.swift b/Discovery/Discovery/Presentation/NativeDiscovery/DiscoveryView.swift index 461a705ea..315034288 100644 --- a/Discovery/Discovery/Presentation/NativeDiscovery/DiscoveryView.swift +++ b/Discovery/Discovery/Presentation/NativeDiscovery/DiscoveryView.swift @@ -54,6 +54,7 @@ public struct DiscoveryView: View { // MARK: - Search fake field HStack(spacing: 11) { Image(systemName: "magnifyingglass") + .foregroundColor(Theme.Colors.textSecondary) .padding(.leading, 16) .padding(.top, 1) Text(DiscoveryLocalization.search) diff --git a/Discovery/Discovery/Presentation/NativeDiscovery/SearchView.swift b/Discovery/Discovery/Presentation/NativeDiscovery/SearchView.swift index 782956544..9d53567d1 100644 --- a/Discovery/Discovery/Presentation/NativeDiscovery/SearchView.swift +++ b/Discovery/Discovery/Presentation/NativeDiscovery/SearchView.swift @@ -36,6 +36,7 @@ public struct SearchView: View { HStack(spacing: 11) { Image(systemName: "magnifyingglass") + .foregroundColor(Theme.Colors.textPrimary) .padding(.leading, 16) .padding(.top, 1) .foregroundColor( @@ -58,6 +59,7 @@ public struct SearchView: View { self.focused = true } .foregroundColor(Theme.Colors.textPrimary) + .font(Theme.Fonts.bodyLarge) Spacer() if !viewModel.searchText.trimmingCharacters(in: .whitespaces).isEmpty { Button(action: { viewModel.searchText.removeAll() }, label: { diff --git a/Discussion/Discussion/Domain/Model/DiscussionPost.swift b/Discussion/Discussion/Domain/Model/DiscussionPost.swift index 398b0888f..e73bc686c 100644 --- a/Discussion/Discussion/Domain/Model/DiscussionPost.swift +++ b/Discussion/Discussion/Domain/Model/DiscussionPost.swift @@ -25,9 +25,9 @@ public enum PostType: String, Codable { public func getImage() -> Image { switch self { case .question: - return CoreAssets.question.swiftUIImage + return CoreAssets.question.swiftUIImage.renderingMode(.template) case .discussion: - return CoreAssets.discussion.swiftUIImage + return CoreAssets.discussion.swiftUIImage.renderingMode(.template) } } } diff --git a/Discussion/Discussion/Presentation/Comments/Base/CommentCell.swift b/Discussion/Discussion/Presentation/Comments/Base/CommentCell.swift index acfb41b5a..ff11baedd 100644 --- a/Discussion/Discussion/Presentation/Comments/Base/CommentCell.swift +++ b/Discussion/Discussion/Presentation/Comments/Base/CommentCell.swift @@ -98,8 +98,9 @@ public struct CommentCell: View { Text(url.absoluteString) .multilineTextAlignment(.leading) } - }.foregroundColor(Theme.Colors.accentColor) - .font(Theme.Fonts.bodyMedium) + } + .foregroundColor(Theme.Colors.accentColor) + .font(Theme.Fonts.bodyMedium) } } @@ -132,8 +133,9 @@ public struct CommentCell: View { Image(systemName: "message.fill") Text("\(comment.responsesCount)") Text(DiscussionLocalization.commentsCount(comment.responsesCount)) - }.foregroundColor(Theme.Colors.textSecondary) - .font(Theme.Fonts.labelLarge) + } + .foregroundColor(Theme.Colors.textSecondary) + .font(Theme.Fonts.labelLarge) } }.foregroundColor(Theme.Colors.accentColor) .font(Theme.Fonts.labelMedium) diff --git a/Discussion/Discussion/Presentation/Comments/Base/ParentCommentView.swift b/Discussion/Discussion/Presentation/Comments/Base/ParentCommentView.swift index 1168f91a5..821e8a342 100644 --- a/Discussion/Discussion/Presentation/Comments/Base/ParentCommentView.swift +++ b/Discussion/Discussion/Presentation/Comments/Base/ParentCommentView.swift @@ -53,10 +53,11 @@ public struct ParentCommentView: View { VStack(alignment: .leading) { Text(comments.authorName) .font(Theme.Fonts.titleMedium) + .foregroundColor(Theme.Colors.textPrimary) Text(comments.postDate .dateToString(style: .lastPost)) .font(Theme.Fonts.labelSmall) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.textSecondaryLight) } Spacer() if isThread { @@ -70,13 +71,15 @@ public struct ParentCommentView: View { .font(Theme.Fonts.bodyMedium) }).foregroundColor(comments.followed ? Theme.Colors.accentColor - : Theme.Colors.textSecondary) + : Theme.Colors.textSecondaryLight) } }.padding(.top, 31) Text(comments.postTitle) .font(Theme.Fonts.titleLarge) + .foregroundColor(Theme.Colors.textPrimary) Text(comments.postBodyHtml.hideHtmlTagsAndUrls()) .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) .fixedSize(horizontal: false, vertical: true) .padding(.bottom, 8) ForEach(Array(comments.postBody.extractURLs().enumerated()), id: \.offset) { _, url in @@ -90,12 +93,12 @@ public struct ParentCommentView: View { } } else { HStack { - Image(systemName: "globe") + Image(systemName: "globe").renderingMode(.template) Link(destination: url) { Text(url.absoluteString) .multilineTextAlignment(.leading) } - }.foregroundColor(Theme.Colors.accentColor) + }.foregroundColor(Theme.Colors.accentXColor) .font(Theme.Fonts.bodyMedium) } } @@ -107,11 +110,13 @@ public struct ParentCommentView: View { ? CoreAssets.voted.swiftUIImage : CoreAssets.vote.swiftUIImage Text("\(comments.votesCount)") + .foregroundColor(Theme.Colors.textPrimary) Text(DiscussionLocalization.votesCount(comments.votesCount)) .font(Theme.Fonts.labelLarge) + .foregroundColor(Theme.Colors.textPrimary) }).foregroundColor(comments.voted ? Theme.Colors.accentColor - : Theme.Colors.textSecondary) + : Theme.Colors.textSecondaryLight) Spacer() Button(action: { onReportTap() @@ -126,7 +131,7 @@ public struct ParentCommentView: View { } .accentColor(comments.abuseFlagged ? Theme.Colors.alert - : Theme.Colors.textSecondary) + : Theme.Colors.textSecondaryLight) .font(Theme.Fonts.labelLarge) .padding(.top, 8) } diff --git a/Discussion/Discussion/Presentation/Comments/Responses/ResponsesView.swift b/Discussion/Discussion/Presentation/Comments/Responses/ResponsesView.swift index 9ccb56e34..34069c0b4 100644 --- a/Discussion/Discussion/Presentation/Comments/Responses/ResponsesView.swift +++ b/Discussion/Discussion/Presentation/Comments/Responses/ResponsesView.swift @@ -45,7 +45,7 @@ public struct ResponsesView: View { viewModel.comments = [] _ = await viewModel.getComments( commentID: commentID, - parentComment: parentComment, + parentComment: parentComment, page: 1 ) }) { @@ -87,10 +87,12 @@ public struct ResponsesView: View { Text("\(viewModel.itemsCount)") Text(DiscussionLocalization.commentsCount(viewModel.itemsCount)) Spacer() - }.padding(.top, 40) - .padding(.bottom, 14) - .padding(.leading, 24) - .font(Theme.Fonts.titleMedium) + } + .padding(.top, 40) + .padding(.bottom, 14) + .padding(.leading, 24) + .font(Theme.Fonts.titleMedium) + .foregroundColor(Theme.Colors.textPrimary) ForEach( Array(comments.comments.enumerated()), id: \.offset ) { index, comment in diff --git a/Discussion/Discussion/Presentation/Comments/Thread/ThreadView.swift b/Discussion/Discussion/Presentation/Comments/Thread/ThreadView.swift index 2249cf192..b004ec6ed 100644 --- a/Discussion/Discussion/Presentation/Comments/Thread/ThreadView.swift +++ b/Discussion/Discussion/Presentation/Comments/Thread/ThreadView.swift @@ -42,7 +42,7 @@ public struct ThreadView: View { if let comments = viewModel.postComments { ParentCommentView( comments: comments, - isThread: true, + isThread: true, onAvatarTap: { username in viewModel.router.showUserDetails(username: username) }, @@ -86,10 +86,12 @@ public struct ThreadView: View { Text("\(viewModel.itemsCount)") Text(DiscussionLocalization.responsesCount(viewModel.itemsCount)) Spacer() - }.padding(.top, 40) - .padding(.bottom, 14) - .padding(.leading, 24) - .font(Theme.Fonts.titleMedium) + } + .padding(.top, 40) + .padding(.bottom, 14) + .padding(.leading, 24) + .font(Theme.Fonts.titleMedium) + .foregroundColor(Theme.Colors.textPrimary) ForEach(Array(comments.comments.enumerated()), id: \.offset) { index, comment in CommentCell( diff --git a/Discussion/Discussion/Presentation/CreateNewThread/CreateNewThreadView.swift b/Discussion/Discussion/Presentation/CreateNewThread/CreateNewThreadView.swift index 265494791..6fe53baea 100644 --- a/Discussion/Discussion/Presentation/CreateNewThread/CreateNewThreadView.swift +++ b/Discussion/Discussion/Presentation/CreateNewThread/CreateNewThreadView.swift @@ -37,8 +37,6 @@ public struct CreateNewThreadView: View { Task { await viewModel.getTopics(courseID: courseID) } - UISegmentedControl.appearance().selectedSegmentTintColor = UIColor(Theme.Colors.accentColor) - UISegmentedControl.appearance().setTitleTextAttributes([.foregroundColor: Theme.Colors.white.uiColor()], for: .selected) } public var body: some View { @@ -73,6 +71,7 @@ public struct CreateNewThreadView: View { // MARK: Topic picker Group { Text(DiscussionLocalization.CreateThread.topic) + .foregroundColor(Theme.Colors.textPrimary) .font(Theme.Fonts.titleSmall) .padding(.top, 16) @@ -89,6 +88,7 @@ public struct CreateNewThreadView: View { Text(viewModel.allTopics.first(where: { $0.id == viewModel.selectedTopic })?.name ?? "") .font(Theme.Fonts.labelLarge) + .foregroundColor(Theme.Colors.textPrimary) .frame(height: 40, alignment: .leading) Spacer() Image(systemName: "chevron.down") @@ -109,10 +109,12 @@ public struct CreateNewThreadView: View { Group { Text(DiscussionLocalization.CreateThread.title) .font(Theme.Fonts.titleSmall) - + Text(" *").foregroundColor(.red) + .foregroundColor(Theme.Colors.textPrimary) + + Text(" *").foregroundColor(Theme.Colors.alert) }.padding(.top, 16) TextField("", text: $postTitle) - .font(Theme.Fonts.labelLarge) + .font(Theme.Fonts.bodyLarge) + .foregroundColor(Theme.Colors.textPrimary) .padding(14) .frame(height: 40) .background( @@ -130,10 +132,12 @@ public struct CreateNewThreadView: View { Group { Text("\(postType.localizedValue.capitalized)") .font(Theme.Fonts.titleSmall) - + Text(" *").foregroundColor(.red) + .foregroundColor(Theme.Colors.textPrimary) + + Text(" *").foregroundColor(Theme.Colors.alert) }.padding(.top, 16) TextEditor(text: $postBody) - .font(Theme.Fonts.labelLarge) + .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) .padding(.horizontal, 10) .padding(.vertical, 10) .frame(height: 200) diff --git a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionSearchTopicsView.swift b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionSearchTopicsView.swift index 637f057be..6deb26098 100644 --- a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionSearchTopicsView.swift +++ b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionSearchTopicsView.swift @@ -31,6 +31,7 @@ public struct DiscussionSearchTopicsView: View { .padding(.bottom, -7) HStack(spacing: 11) { Image(systemName: "magnifyingglass") + .foregroundColor(Theme.Colors.textPrimary) .padding(.leading, 16) .padding(.top, -1) .foregroundColor( diff --git a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift index dcff23388..c5d84f55c 100644 --- a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift +++ b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift @@ -28,6 +28,7 @@ public struct DiscussionTopicsView: View { // MARK: - Search fake field HStack(spacing: 11) { Image(systemName: "magnifyingglass") + .foregroundColor(Theme.Colors.textSecondary) .padding(.leading, 16) .padding(.top, 1) Text(DiscussionLocalization.Topics.search) @@ -78,9 +79,11 @@ public struct DiscussionTopicsView: View { }, label: { VStack { Spacer(minLength: 0) - CoreAssets.allPosts.swiftUIImage + CoreAssets.allPosts.swiftUIImage.renderingMode(.template) + .foregroundColor(Theme.Colors.textPrimary) Text(allTopics.name) .font(Theme.Fonts.titleSmall) + .foregroundColor(Theme.Colors.textPrimary) Spacer(minLength: 0) } .frame(maxWidth: .infinity) @@ -94,9 +97,11 @@ public struct DiscussionTopicsView: View { }, label: { VStack(alignment: .center) { Spacer(minLength: 0) - CoreAssets.followed.swiftUIImage + CoreAssets.followed.swiftUIImage.renderingMode(.template) + .foregroundColor(Theme.Colors.textPrimary) Text(followed.name) .font(Theme.Fonts.titleSmall) + .foregroundColor(Theme.Colors.textPrimary) Spacer(minLength: 0) } .frame(maxWidth: .infinity) diff --git a/Discussion/Discussion/Presentation/Posts/PostsView.swift b/Discussion/Discussion/Presentation/Posts/PostsView.swift index ab24def7c..5b3da4cfb 100644 --- a/Discussion/Discussion/Presentation/Posts/PostsView.swift +++ b/Discussion/Discussion/Presentation/Posts/PostsView.swift @@ -293,6 +293,7 @@ public struct PostCell: View { VStack(alignment: .leading, spacing: 8) { HStack(spacing: 4) { post.type.getImage() + .foregroundColor(Theme.Colors.accentColor) Text(post.type.localizedValue.capitalized) Spacer() if post.unreadCommentCount - 1 > 0 { diff --git a/Profile/Profile/Presentation/EditProfile/EditProfileView.swift b/Profile/Profile/Presentation/EditProfile/EditProfileView.swift index ffeecd11b..313da0f2f 100644 --- a/Profile/Profile/Presentation/EditProfile/EditProfileView.swift +++ b/Profile/Profile/Presentation/EditProfile/EditProfileView.swift @@ -80,6 +80,8 @@ public struct EditProfileView: View { Text(ProfileLocalization.Edit.Fields.aboutMe) .font(Theme.Fonts.titleMedium) TextEditor(text: $viewModel.profileChanges.shortBiography) + .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) .padding(.horizontal, 12) .padding(.vertical, 4) .frame(height: 200) diff --git a/Profile/Profile/Presentation/Profile/ProfileView.swift b/Profile/Profile/Presentation/Profile/ProfileView.swift index 6354d5999..5142f205d 100644 --- a/Profile/Profile/Presentation/Profile/ProfileView.swift +++ b/Profile/Profile/Presentation/Profile/ProfileView.swift @@ -106,6 +106,7 @@ public struct ProfileView: View { .padding(.top, 30) Text(viewModel.userModel?.name ?? "") .font(Theme.Fonts.headlineSmall) + .foregroundColor(Theme.Colors.textPrimary) .padding(.top, 20) Text("@\(viewModel.userModel?.username ?? "")") .font(Theme.Fonts.labelLarge) diff --git a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift index aa04f1d21..6a053abe5 100644 --- a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift +++ b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift @@ -105,6 +105,8 @@ struct ProfileSupportInfoView: View { HStack { Text(viewModel.title) .multilineTextAlignment(.leading) + .font(Theme.Fonts.bodyMedium) + .foregroundColor(Theme.Colors.textPrimary) Spacer() Image(systemName: "chevron.right") } @@ -133,6 +135,8 @@ struct ProfileSupportInfoView: View { } label: { HStack { Text(linkViewModel.title) + .foregroundColor(Theme.Colors.textPrimary) + .font(Theme.Fonts.bodyMedium) Spacer() Image(systemName: "chevron.right") } From a36ebdbc1b99d0269d4525d5b0ada8966a80912d Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Fri, 1 Mar 2024 17:34:12 +0500 Subject: [PATCH 07/21] refactor: color combination improvements for light dark modes --- .../Authorization/Presentation/Startup/StartupView.swift | 2 +- Core/Core/Extensions/UIApplicationExtension.swift | 4 ++-- Core/Core/View/Base/CheckBoxView.swift | 2 +- Core/Core/View/Base/PickerMenu.swift | 1 - .../Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift | 2 +- .../CourseStructure/CourseStructureNestedListView.swift | 4 ++-- OpenEdX/View/MainScreenView.swift | 2 +- .../Presentation/DeleteAccount/DeleteAccountView.swift | 8 ++++---- Profile/Profile/Presentation/Profile/ProfileView.swift | 4 ++-- .../Profile/UserProfile/UserProfileView.swift | 1 + 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Authorization/Authorization/Presentation/Startup/StartupView.swift b/Authorization/Authorization/Presentation/Startup/StartupView.swift index d68e97c62..bf5313947 100644 --- a/Authorization/Authorization/Presentation/Startup/StartupView.swift +++ b/Authorization/Authorization/Presentation/Startup/StartupView.swift @@ -89,7 +89,7 @@ public struct StartupView: View { } label: { Text(AuthLocalization.Startup.exploreAllCourses) .underline() - .foregroundColor(Theme.Colors.accentColor) + .foregroundColor(Theme.Colors.accentXColor) .font(Theme.Fonts.bodyLarge) } .padding(.top, isHorizontal ? 0 : 5) diff --git a/Core/Core/Extensions/UIApplicationExtension.swift b/Core/Core/Extensions/UIApplicationExtension.swift index 39dfa7692..3f1eaaf3e 100644 --- a/Core/Core/Extensions/UIApplicationExtension.swift +++ b/Core/Core/Extensions/UIApplicationExtension.swift @@ -59,9 +59,9 @@ extension UINavigationController { .font: Theme.UIFonts.labelLarge() ], for: .normal) - UISegmentedControl.appearance().selectedSegmentTintColor = UIColor(Theme.Colors.accentColor) + UISegmentedControl.appearance().selectedSegmentTintColor = UIColor(Theme.Colors.accentXColor) - UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = Theme.UIColors.accentColor + UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = Theme.UIColors.accentXColor } } diff --git a/Core/Core/View/Base/CheckBoxView.swift b/Core/Core/View/Base/CheckBoxView.swift index a900d292a..efed96ccc 100644 --- a/Core/Core/View/Base/CheckBoxView.swift +++ b/Core/Core/View/Base/CheckBoxView.swift @@ -26,7 +26,7 @@ public struct CheckBoxView: View { systemName: checked ? "checkmark.square.fill" : "square" ) .foregroundColor( - checked ? Theme.Colors.accentColor : Theme.Colors.textPrimary + checked ? Theme.Colors.accentXColor : Theme.Colors.textPrimary ) Text(text) .font(font) diff --git a/Core/Core/View/Base/PickerMenu.swift b/Core/Core/View/Base/PickerMenu.swift index 9bacdbe65..2066a8aa0 100644 --- a/Core/Core/View/Base/PickerMenu.swift +++ b/Core/Core/View/Base/PickerMenu.swift @@ -88,7 +88,6 @@ public struct PickerMenu: View { .font(Theme.Fonts.bodySmall) .background(Theme.Colors.textInputStroke.cornerRadius(6)) .accessibilityIdentifier("picker_search_textfield") - .foregroundColor(Theme.Colors.textPrimary) Picker("", selection: $selectedItem) { ForEach(filteredItems, id: \.self) { item in Text(item.value) diff --git a/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift b/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift index 29401776f..129a5f6b9 100644 --- a/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift +++ b/Core/Core/View/Base/ScrollSlidingTabBar/ScrollSlidingTabBar.swift @@ -162,7 +162,7 @@ extension ScrollSlidingTabBar { public static let `default` = Style( font: Theme.Fonts.bodyLarge, selectedFont: Theme.Fonts.titleMedium, - activeAccentColor: Theme.Colors.accentColor, + activeAccentColor: Theme.Colors.accentXColor, inactiveAccentColor: Theme.Colors.textSecondary, indicatorHeight: 2, borderColor: .gray.opacity(0.2), diff --git a/Course/Course/Presentation/Outline/CourseStructure/CourseStructureNestedListView.swift b/Course/Course/Presentation/Outline/CourseStructure/CourseStructureNestedListView.swift index a868c19fa..e057b3b7c 100644 --- a/Course/Course/Presentation/Outline/CourseStructure/CourseStructureNestedListView.swift +++ b/Course/Course/Presentation/Outline/CourseStructure/CourseStructureNestedListView.swift @@ -50,8 +50,8 @@ struct CourseStructureNestedListView: View { .lineLimit(1) .foregroundColor(Theme.Colors.textPrimary) Spacer() - Image(systemName: "chevron.down") - .foregroundColor(Theme.Colors.accentColor) + Image(systemName: "chevron.down").renderingMode(.template) + .foregroundColor(Theme.Colors.accentXColor) .dropdownArrowRotationAnimation(value: isExpanded) } .padding(.horizontal, 30) diff --git a/OpenEdX/View/MainScreenView.swift b/OpenEdX/View/MainScreenView.swift index fd022b374..03bc5a58b 100644 --- a/OpenEdX/View/MainScreenView.swift +++ b/OpenEdX/View/MainScreenView.swift @@ -175,7 +175,7 @@ struct MainScreenView: View { await viewModel.prefetchDataForOffline() } } - .accentColor(Theme.Colors.accentColor) + .accentColor(Theme.Colors.accentXColor) } private func titleBar() -> String { diff --git a/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift b/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift index 67967fb2f..78da9062a 100644 --- a/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift +++ b/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift @@ -119,18 +119,18 @@ public struct DeleteAccountView: View { HStack(spacing: 9) { CoreAssets.arrowRight16.swiftUIImage.renderingMode(.template) .rotationEffect(Angle(degrees: 180)) - .foregroundColor(Theme.Colors.accentColor) + .foregroundColor(Theme.Colors.secondaryButtonTextColor) Text(ProfileLocalization.DeleteAccount.backToProfile) .font(Theme.Fonts.labelLarge) - .foregroundColor(Theme.Colors.accentColor) + .foregroundColor(Theme.Colors.secondaryButtonTextColor) } }) - .padding(.top, 35) + .padding(.top, 5) .accessibilityIdentifier("back_button") .frame(maxWidth: .infinity, minHeight: 42) .background( Theme.Shapes.buttonShape - .fill(Theme.Colors.white) + .fill(.clear) ) .overlay( Theme.Shapes.buttonShape diff --git a/Profile/Profile/Presentation/Profile/ProfileView.swift b/Profile/Profile/Presentation/Profile/ProfileView.swift index 03d313211..1e76e1f22 100644 --- a/Profile/Profile/Presentation/Profile/ProfileView.swift +++ b/Profile/Profile/Presentation/Profile/ProfileView.swift @@ -144,7 +144,7 @@ public struct ProfileView: View { if viewModel.userModel?.yearOfBirth != 0 { HStack { Text(ProfileLocalization.Edit.Fields.yearOfBirth) - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.textPrimary) .accessibilityIdentifier("yob_text") Text(String(viewModel.userModel?.yearOfBirth ?? 0)) .accessibilityIdentifier("yob_value_text") @@ -153,7 +153,7 @@ public struct ProfileView: View { if let bio = viewModel.userModel?.shortBiography, bio != "" { HStack(alignment: .top) { Text(ProfileLocalization.bio + " ") - .foregroundColor(Theme.Colors.textSecondary) + .foregroundColor(Theme.Colors.textPrimary) + Text(bio) } .accessibilityIdentifier("bio_text") diff --git a/Profile/Profile/Presentation/Profile/UserProfile/UserProfileView.swift b/Profile/Profile/Presentation/Profile/UserProfile/UserProfileView.swift index 870060a77..905f03681 100644 --- a/Profile/Profile/Presentation/Profile/UserProfile/UserProfileView.swift +++ b/Profile/Profile/Presentation/Profile/UserProfile/UserProfileView.swift @@ -50,6 +50,7 @@ public struct UserProfileView: View { Text(ProfileLocalization.info) .padding(.horizontal, 24) .font(Theme.Fonts.labelLarge) + .foregroundColor(Theme.Colors.textSecondary) VStack(alignment: .leading, spacing: 16) { if viewModel.userModel?.yearOfBirth != 0 { From e6f08c1832f9ca88090903c3219e01f80726fa47 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Mon, 4 Mar 2024 16:44:24 +0500 Subject: [PATCH 08/21] chore: theme improvements --- .../Presentation/Login/SignInView.swift | 2 +- Core/Core/View/Base/AlertView.swift | 6 +-- Core/Core/View/Base/CourseCellView.swift | 2 +- .../View/Base/VideoDownloadQualityView.swift | 4 +- Core/Core/View/Base/WebBrowser.swift | 6 ++- .../WebPrograms/ProgramWebviewView.swift | 3 +- OpenEdX/View/MainScreenView.swift | 4 +- .../DeleteAccount/DeleteAccountView.swift | 1 + .../Presentation/Profile/ProfileView.swift | 2 + .../Subviews/ProfileSupportInfoView.swift | 6 +-- .../Presentation/Settings/SettingsView.swift | 4 +- Theme/Theme.xcodeproj/project.pbxproj | 16 ++++---- .../Contents.json | 38 +++++++++++++++++++ .../Colors/TabbarColor.colorset/Contents.json | 38 +++++++++++++++++++ Theme/Theme/SwiftGen/ThemeAssets.swift | 2 + Theme/Theme/Theme.swift | 8 +++- 16 files changed, 117 insertions(+), 25 deletions(-) create mode 100644 Theme/Theme/Assets.xcassets/Colors/PrimaryButtonTextColor.colorset/Contents.json create mode 100644 Theme/Theme/Assets.xcassets/Colors/TabbarColor.colorset/Contents.json diff --git a/Authorization/Authorization/Presentation/Login/SignInView.swift b/Authorization/Authorization/Presentation/Login/SignInView.swift index 25592c025..c84a32862 100644 --- a/Authorization/Authorization/Presentation/Login/SignInView.swift +++ b/Authorization/Authorization/Presentation/Login/SignInView.swift @@ -128,7 +128,7 @@ public struct SignInView: View { viewModel.router.showForgotPasswordScreen() } .font(Theme.Fonts.bodyMedium) - .foregroundColor(Theme.Colors.accentColor) + .foregroundColor(Theme.Colors.accentXColor) .padding(.top, 0) .accessibilityIdentifier("forgot_password_button") } diff --git a/Core/Core/View/Base/AlertView.swift b/Core/Core/View/Base/AlertView.swift index 021cd6dac..ff79856c4 100644 --- a/Core/Core/View/Base/AlertView.swift +++ b/Core/Core/View/Base/AlertView.swift @@ -268,7 +268,7 @@ public struct AlertView: View { }, label: { ZStack { Text(CoreLocalization.Alert.logout) - .foregroundColor(Theme.Colors.white) + .foregroundColor(Theme.Colors.primaryButtonTextColor) .font(Theme.Fonts.labelLarge) .frame(maxWidth: .infinity) .padding(.horizontal, 16) @@ -300,7 +300,7 @@ public struct AlertView: View { }, label: { ZStack { Text(CoreLocalization.Alert.leave) - .foregroundColor(Theme.Colors.white) + .foregroundColor(Theme.Colors.primaryButtonTextColor) .font(Theme.Fonts.labelLarge) .frame(maxWidth: .infinity) .padding(.horizontal, 16) @@ -359,7 +359,7 @@ public struct AlertView: View { } label: { ZStack { Text(CoreLocalization.Alert.delete) - .foregroundColor(Theme.Colors.white) + .foregroundColor(Theme.Colors.primaryButtonTextColor) .font(Theme.Fonts.labelLarge) .frame(maxWidth: .infinity) .padding(.horizontal, 16) diff --git a/Core/Core/View/Base/CourseCellView.swift b/Core/Core/View/Base/CourseCellView.swift index 2d8ea1c24..6166b81a3 100644 --- a/Core/Core/View/Base/CourseCellView.swift +++ b/Core/Core/View/Base/CourseCellView.swift @@ -85,7 +85,7 @@ public struct CourseCellView: View { .resizable() .frame(width: 16, height: 16) .offset(x: 15) - .foregroundColor(Theme.Colors.accentColor) + .foregroundColor(Theme.Colors.accentXColor) .accessibilityIdentifier("arrow_image") } } diff --git a/Core/Core/View/Base/VideoDownloadQualityView.swift b/Core/Core/View/Base/VideoDownloadQualityView.swift index 6ffa52466..b4bb391c6 100644 --- a/Core/Core/View/Base/VideoDownloadQualityView.swift +++ b/Core/Core/View/Base/VideoDownloadQualityView.swift @@ -108,11 +108,11 @@ public struct SettingsCell: View { public var body: some View { VStack(alignment: .leading) { Text(title) - .font(Theme.Fonts.titleMedium) + .font(Theme.Fonts.labelLarge) .accessibilityIdentifier("video_quality_title_text") if let description { Text(description) - .font(Theme.Fonts.labelMedium) + .font(Theme.Fonts.labelSmall) .foregroundColor(Theme.Colors.textSecondary) .accessibilityIdentifier("video_quality_des_text") } diff --git a/Core/Core/View/Base/WebBrowser.swift b/Core/Core/View/Base/WebBrowser.swift index 776c14733..8f441bacd 100644 --- a/Core/Core/View/Base/WebBrowser.swift +++ b/Core/Core/View/Base/WebBrowser.swift @@ -54,7 +54,11 @@ public struct WebBrowser: View { leftButtonAction: { presentationMode.wrappedValue.dismiss() } ) WebView( - viewModel: .init(url: url, baseURL: ""), + viewModel: .init( + url: url, + baseURL: "", + injections: [.colorInversionCss] + ), isLoading: $isLoading, refreshCookies: {} ) diff --git a/Discovery/Discovery/Presentation/WebPrograms/ProgramWebviewView.swift b/Discovery/Discovery/Presentation/WebPrograms/ProgramWebviewView.swift index d5a1b4f8f..099846af3 100644 --- a/Discovery/Discovery/Presentation/WebPrograms/ProgramWebviewView.swift +++ b/Discovery/Discovery/Presentation/WebPrograms/ProgramWebviewView.swift @@ -58,7 +58,8 @@ public struct ProgramWebviewView: View { WebView( viewModel: .init( url: URLString, - baseURL: "" + baseURL: "", + injections: [.colorInversionCss] ), isLoading: $isLoading, refreshCookies: { diff --git a/OpenEdX/View/MainScreenView.swift b/OpenEdX/View/MainScreenView.swift index 03bc5a58b..b3895ab1d 100644 --- a/OpenEdX/View/MainScreenView.swift +++ b/OpenEdX/View/MainScreenView.swift @@ -34,8 +34,8 @@ struct MainScreenView: View { init(viewModel: MainScreenViewModel) { self.viewModel = viewModel UITabBar.appearance().isTranslucent = false - UITabBar.appearance().barTintColor = UIColor(Theme.Colors.textInputUnfocusedBackground) - UITabBar.appearance().backgroundColor = UIColor(Theme.Colors.textInputUnfocusedBackground) + UITabBar.appearance().barTintColor = UIColor(Theme.Colors.tabbarColor) + UITabBar.appearance().backgroundColor = UIColor(Theme.Colors.tabbarColor) UITabBar.appearance().unselectedItemTintColor = UIColor(Theme.Colors.textSecondaryLight) UITabBarItem.appearance().setTitleTextAttributes( diff --git a/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift b/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift index 78da9062a..2373b01b8 100644 --- a/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift +++ b/Profile/Profile/Presentation/DeleteAccount/DeleteAccountView.swift @@ -107,6 +107,7 @@ public struct DeleteAccountView: View { try await viewModel.deleteAccount(password: viewModel.password) } }, color: Theme.Colors.accentColor, + textColor: Theme.Colors.primaryButtonTextColor, isActive: viewModel.password.count >= 2) .padding(.top, 18) .accessibilityIdentifier("delete_account_button") diff --git a/Profile/Profile/Presentation/Profile/ProfileView.swift b/Profile/Profile/Presentation/Profile/ProfileView.swift index 1e76e1f22..0e0755e40 100644 --- a/Profile/Profile/Presentation/Profile/ProfileView.swift +++ b/Profile/Profile/Presentation/Profile/ProfileView.swift @@ -149,6 +149,7 @@ public struct ProfileView: View { Text(String(viewModel.userModel?.yearOfBirth ?? 0)) .accessibilityIdentifier("yob_value_text") } + .font(Theme.Fonts.bodyLarge) } if let bio = viewModel.userModel?.shortBiography, bio != "" { HStack(alignment: .top) { @@ -193,6 +194,7 @@ public struct ProfileView: View { }, label: { HStack { Text(ProfileLocalization.settingsVideo) + .font(Theme.Fonts.bodyLarge) Spacer() Image(systemName: "chevron.right") } diff --git a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift index 54338d755..f6f556a1d 100644 --- a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift +++ b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift @@ -114,7 +114,7 @@ struct ProfileSupportInfoView: View { HStack { Text(viewModel.title) .multilineTextAlignment(.leading) - .font(Theme.Fonts.bodyMedium) + .font(Theme.Fonts.labelLarge) .foregroundColor(Theme.Colors.textPrimary) Spacer() Image(systemName: "chevron.right") @@ -145,7 +145,7 @@ struct ProfileSupportInfoView: View { HStack { Text(linkViewModel.title) .foregroundColor(Theme.Colors.textPrimary) - .font(Theme.Fonts.bodyMedium) + .font(Theme.Fonts.labelLarge) Spacer() Image(systemName: "chevron.right") } @@ -173,6 +173,7 @@ struct ProfileSupportInfoView: View { .frame(width: 24, height: 24) } Text("\(ProfileLocalization.Settings.version) \(viewModel.currentVersion)") + .font(Theme.Fonts.labelLarge) } switch viewModel.versionState { case .actual: @@ -201,7 +202,6 @@ struct ProfileSupportInfoView: View { .frame(width: 24, height: 24) .foregroundStyle(Theme.Colors.accentColor) } - } }) .disabled(viewModel.versionState == .actual) diff --git a/Profile/Profile/Presentation/Settings/SettingsView.swift b/Profile/Profile/Presentation/Settings/SettingsView.swift index 7dc184467..ed423d84f 100644 --- a/Profile/Profile/Presentation/Settings/SettingsView.swift +++ b/Profile/Profile/Presentation/Settings/SettingsView.swift @@ -152,11 +152,11 @@ public struct SettingsCell: View { public var body: some View { VStack(alignment: .leading) { Text(title) - .font(Theme.Fonts.titleMedium) + .font(Theme.Fonts.bodyLarge) .accessibilityIdentifier("video_settings_text") if let description { Text(description) - .font(Theme.Fonts.labelMedium) + .font(Theme.Fonts.bodySmall) .foregroundColor(Theme.Colors.textSecondary) .accessibilityIdentifier("video_settings_sub_text") } diff --git a/Theme/Theme.xcodeproj/project.pbxproj b/Theme/Theme.xcodeproj/project.pbxproj index e67d7eb3d..66cb9579d 100644 --- a/Theme/Theme.xcodeproj/project.pbxproj +++ b/Theme/Theme.xcodeproj/project.pbxproj @@ -502,7 +502,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = L8PG7LC3Y3; + DEVELOPMENT_TEAM = 9G78FK843Y; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -595,7 +595,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = L8PG7LC3Y3; + DEVELOPMENT_TEAM = 9G78FK843Y; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -693,7 +693,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = L8PG7LC3Y3; + DEVELOPMENT_TEAM = 9G78FK843Y; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -786,7 +786,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = L8PG7LC3Y3; + DEVELOPMENT_TEAM = 9G78FK843Y; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -884,7 +884,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = L8PG7LC3Y3; + DEVELOPMENT_TEAM = 9G78FK843Y; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -977,7 +977,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = L8PG7LC3Y3; + DEVELOPMENT_TEAM = 9G78FK843Y; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1133,7 +1133,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = L8PG7LC3Y3; + DEVELOPMENT_TEAM = 9G78FK843Y; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1168,7 +1168,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = L8PG7LC3Y3; + DEVELOPMENT_TEAM = 9G78FK843Y; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; diff --git a/Theme/Theme/Assets.xcassets/Colors/PrimaryButtonTextColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/PrimaryButtonTextColor.colorset/Contents.json new file mode 100644 index 000000000..22c4bb0a8 --- /dev/null +++ b/Theme/Theme/Assets.xcassets/Colors/PrimaryButtonTextColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Theme/Theme/Assets.xcassets/Colors/TabbarColor.colorset/Contents.json b/Theme/Theme/Assets.xcassets/Colors/TabbarColor.colorset/Contents.json new file mode 100644 index 000000000..2d9b9cd70 --- /dev/null +++ b/Theme/Theme/Assets.xcassets/Colors/TabbarColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.984", + "green" : "0.980", + "red" : "0.976" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.275", + "green" : "0.200", + "red" : "0.153" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Theme/Theme/SwiftGen/ThemeAssets.swift b/Theme/Theme/SwiftGen/ThemeAssets.swift index 8d352f649..38de85b3b 100644 --- a/Theme/Theme/SwiftGen/ThemeAssets.swift +++ b/Theme/Theme/SwiftGen/ThemeAssets.swift @@ -45,6 +45,7 @@ public enum ThemeAssets { public static let pastDueTimelineColor = ColorAsset(name: "pastDueTimelineColor") public static let loginBackground = ColorAsset(name: "LoginBackground") public static let loginNavigationText = ColorAsset(name: "LoginNavigationText") + public static let primaryButtonTextColor = ColorAsset(name: "PrimaryButtonTextColor") public static let onProgress = ColorAsset(name: "OnProgress") public static let progressDone = ColorAsset(name: "ProgressDone") public static let progressSkip = ColorAsset(name: "ProgressSkip") @@ -59,6 +60,7 @@ public enum ThemeAssets { public static let splashBackground = ColorAsset(name: "SplashBackground") public static let styledButtonText = ColorAsset(name: "StyledButtonText") public static let success = ColorAsset(name: "Success") + public static let tabbarColor = ColorAsset(name: "TabbarColor") public static let textPrimary = ColorAsset(name: "TextPrimary") public static let textSecondary = ColorAsset(name: "TextSecondary") public static let textSecondaryLight = ColorAsset(name: "TextSecondaryLight") diff --git a/Theme/Theme/Theme.swift b/Theme/Theme/Theme.swift index 75110db9a..f48fa1ba5 100644 --- a/Theme/Theme/Theme.swift +++ b/Theme/Theme/Theme.swift @@ -56,6 +56,8 @@ public struct Theme { public private(set) static var secondaryButtonBorderColor = ThemeAssets.secondaryButtonBorderColor.swiftUIColor public private(set) static var secondaryButtonTextColor = ThemeAssets.secondaryButtonTextColor.swiftUIColor public private(set) static var success = ThemeAssets.success.swiftUIColor + public private(set) static var tabbarColor = ThemeAssets.tabbarColor.swiftUIColor + public private(set) static var primaryButtonTextColor = ThemeAssets.primaryButtonTextColor.swiftUIColor public static func update( accentColor: Color = ThemeAssets.accentColor.swiftUIColor, @@ -95,7 +97,9 @@ public struct Theme { navigationBarTintColor: Color = ThemeAssets.navigationBarTintColor.swiftUIColor, secondaryButtonBorderColor: Color = ThemeAssets.secondaryButtonBorderColor.swiftUIColor, secondaryButtonTextColor: Color = ThemeAssets.secondaryButtonTextColor.swiftUIColor, - success: Color = ThemeAssets.success.swiftUIColor + success: Color = ThemeAssets.success.swiftUIColor, + tabbarColor: Color = ThemeAssets.tabbarColor.swiftUIColor, + primaryButtonTextColor: Color = ThemeAssets.primaryButtonTextColor.swiftUIColor ) { self.accentColor = accentColor self.accentXColor = accentXColor @@ -135,6 +139,8 @@ public struct Theme { self.secondaryButtonBorderColor = secondaryButtonBorderColor self.secondaryButtonTextColor = secondaryButtonTextColor self.success = success + self.tabbarColor = tabbarColor + self.primaryButtonTextColor = primaryButtonTextColor } } From 8ea2cb8562d141865830efdbe8d989d97f3f3bb1 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Mon, 4 Mar 2024 17:25:22 +0500 Subject: [PATCH 09/21] refactor: improvement --- .../View/Base/VideoDownloadQualityView.swift | 4 ++-- .../Presentation/Profile/ProfileView.swift | 7 ++++--- .../Subviews/ProfileSupportInfoView.swift | 6 +++--- .../Presentation/Settings/SettingsView.swift | 2 +- Theme/Theme.xcodeproj/project.pbxproj | 16 ++++++++-------- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Core/Core/View/Base/VideoDownloadQualityView.swift b/Core/Core/View/Base/VideoDownloadQualityView.swift index b4bb391c6..7585d4c57 100644 --- a/Core/Core/View/Base/VideoDownloadQualityView.swift +++ b/Core/Core/View/Base/VideoDownloadQualityView.swift @@ -108,11 +108,11 @@ public struct SettingsCell: View { public var body: some View { VStack(alignment: .leading) { Text(title) - .font(Theme.Fonts.labelLarge) + .font(Theme.Fonts.titleMedium) .accessibilityIdentifier("video_quality_title_text") if let description { Text(description) - .font(Theme.Fonts.labelSmall) + .font(Theme.Fonts.bodySmall) .foregroundColor(Theme.Colors.textSecondary) .accessibilityIdentifier("video_quality_des_text") } diff --git a/Profile/Profile/Presentation/Profile/ProfileView.swift b/Profile/Profile/Presentation/Profile/ProfileView.swift index 0e0755e40..c1e3499c0 100644 --- a/Profile/Profile/Presentation/Profile/ProfileView.swift +++ b/Profile/Profile/Presentation/Profile/ProfileView.swift @@ -144,12 +144,13 @@ public struct ProfileView: View { if viewModel.userModel?.yearOfBirth != 0 { HStack { Text(ProfileLocalization.Edit.Fields.yearOfBirth) - .foregroundColor(Theme.Colors.textPrimary) + .foregroundColor(Theme.Colors.textSecondary) .accessibilityIdentifier("yob_text") Text(String(viewModel.userModel?.yearOfBirth ?? 0)) + .foregroundColor(Theme.Colors.textPrimary) .accessibilityIdentifier("yob_value_text") } - .font(Theme.Fonts.bodyLarge) + .font(Theme.Fonts.titleMedium) } if let bio = viewModel.userModel?.shortBiography, bio != "" { HStack(alignment: .top) { @@ -194,7 +195,7 @@ public struct ProfileView: View { }, label: { HStack { Text(ProfileLocalization.settingsVideo) - .font(Theme.Fonts.bodyLarge) + .font(Theme.Fonts.titleMedium) Spacer() Image(systemName: "chevron.right") } diff --git a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift index f6f556a1d..134b38536 100644 --- a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift +++ b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift @@ -114,7 +114,7 @@ struct ProfileSupportInfoView: View { HStack { Text(viewModel.title) .multilineTextAlignment(.leading) - .font(Theme.Fonts.labelLarge) + .font(Theme.Fonts.titleMedium) .foregroundColor(Theme.Colors.textPrimary) Spacer() Image(systemName: "chevron.right") @@ -145,7 +145,7 @@ struct ProfileSupportInfoView: View { HStack { Text(linkViewModel.title) .foregroundColor(Theme.Colors.textPrimary) - .font(Theme.Fonts.labelLarge) + .font(Theme.Fonts.titleMedium) Spacer() Image(systemName: "chevron.right") } @@ -173,7 +173,7 @@ struct ProfileSupportInfoView: View { .frame(width: 24, height: 24) } Text("\(ProfileLocalization.Settings.version) \(viewModel.currentVersion)") - .font(Theme.Fonts.labelLarge) + .font(Theme.Fonts.titleMedium) } switch viewModel.versionState { case .actual: diff --git a/Profile/Profile/Presentation/Settings/SettingsView.swift b/Profile/Profile/Presentation/Settings/SettingsView.swift index ed423d84f..494ecca11 100644 --- a/Profile/Profile/Presentation/Settings/SettingsView.swift +++ b/Profile/Profile/Presentation/Settings/SettingsView.swift @@ -152,7 +152,7 @@ public struct SettingsCell: View { public var body: some View { VStack(alignment: .leading) { Text(title) - .font(Theme.Fonts.bodyLarge) + .font(Theme.Fonts.titleMedium) .accessibilityIdentifier("video_settings_text") if let description { Text(description) diff --git a/Theme/Theme.xcodeproj/project.pbxproj b/Theme/Theme.xcodeproj/project.pbxproj index 66cb9579d..e67d7eb3d 100644 --- a/Theme/Theme.xcodeproj/project.pbxproj +++ b/Theme/Theme.xcodeproj/project.pbxproj @@ -502,7 +502,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9G78FK843Y; + DEVELOPMENT_TEAM = L8PG7LC3Y3; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -595,7 +595,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9G78FK843Y; + DEVELOPMENT_TEAM = L8PG7LC3Y3; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -693,7 +693,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9G78FK843Y; + DEVELOPMENT_TEAM = L8PG7LC3Y3; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -786,7 +786,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9G78FK843Y; + DEVELOPMENT_TEAM = L8PG7LC3Y3; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -884,7 +884,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9G78FK843Y; + DEVELOPMENT_TEAM = L8PG7LC3Y3; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -977,7 +977,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9G78FK843Y; + DEVELOPMENT_TEAM = L8PG7LC3Y3; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1133,7 +1133,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9G78FK843Y; + DEVELOPMENT_TEAM = L8PG7LC3Y3; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1168,7 +1168,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9G78FK843Y; + DEVELOPMENT_TEAM = L8PG7LC3Y3; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; From 0c181b7a8b88266fb564bea64e2c9094320af43f Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Mon, 4 Mar 2024 21:14:47 +0500 Subject: [PATCH 10/21] chore: set application tint color as per accent color --- Core/Core/Extensions/UIApplicationExtension.swift | 2 +- OpenEdX/AppDelegate.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/Core/Extensions/UIApplicationExtension.swift b/Core/Core/Extensions/UIApplicationExtension.swift index 3f1eaaf3e..00b7651fe 100644 --- a/Core/Core/Extensions/UIApplicationExtension.swift +++ b/Core/Core/Extensions/UIApplicationExtension.swift @@ -55,7 +55,7 @@ extension UINavigationController { UISegmentedControl.appearance().setTitleTextAttributes( [ - .foregroundColor: Theme.Colors.white.uiColor(), + .foregroundColor: Theme.Colors.primaryButtonTextColor.uiColor(), .font: Theme.UIFonts.labelLarge() ], for: .normal) diff --git a/OpenEdX/AppDelegate.swift b/OpenEdX/AppDelegate.swift index 1f71d7209..59138b48c 100644 --- a/OpenEdX/AppDelegate.swift +++ b/OpenEdX/AppDelegate.swift @@ -48,6 +48,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { window = UIWindow(frame: UIScreen.main.bounds) window?.rootViewController = RouteController() window?.makeKeyAndVisible() + window?.tintColor = Theme.UIColors.accentColor NotificationCenter.default.addObserver( self, From f931ae82dbe894626a35bc5b1e027b4c8cbf26ff Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Mon, 4 Mar 2024 21:40:01 +0500 Subject: [PATCH 11/21] refactor: fix logo color and forgot password style --- Authorization/Authorization/Presentation/Login/SignInView.swift | 2 +- .../Authorization/Presentation/Startup/StartupView.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Authorization/Authorization/Presentation/Login/SignInView.swift b/Authorization/Authorization/Presentation/Login/SignInView.swift index c84a32862..9d9acb0d9 100644 --- a/Authorization/Authorization/Presentation/Login/SignInView.swift +++ b/Authorization/Authorization/Presentation/Login/SignInView.swift @@ -127,7 +127,7 @@ public struct SignInView: View { viewModel.trackForgotPasswordClicked() viewModel.router.showForgotPasswordScreen() } - .font(Theme.Fonts.bodyMedium) + .font(Theme.Fonts.titleMedium) .foregroundColor(Theme.Colors.accentXColor) .padding(.top, 0) .accessibilityIdentifier("forgot_password_button") diff --git a/Authorization/Authorization/Presentation/Startup/StartupView.swift b/Authorization/Authorization/Presentation/Startup/StartupView.swift index bf5313947..5d56c01cc 100644 --- a/Authorization/Authorization/Presentation/Startup/StartupView.swift +++ b/Authorization/Authorization/Presentation/Startup/StartupView.swift @@ -26,7 +26,7 @@ public struct StartupView: View { public var body: some View { ZStack(alignment: .top) { VStack(alignment: .leading) { - ThemeAssets.appLogo.swiftUIImage + ThemeAssets.appLogo.swiftUIImage.renderingMode(.template) .resizable() .aspectRatio(contentMode: .fit) .frame(maxWidth: 189, maxHeight: 89) From ac10c9d252c52d4962dcd759fbd2a3e477a233e3 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Tue, 5 Mar 2024 09:10:27 +0500 Subject: [PATCH 12/21] fix: handouts colors fix --- Core/Core/Configuration/CSSInjector.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Core/Configuration/CSSInjector.swift b/Core/Core/Configuration/CSSInjector.swift index 59beef4cd..689b30923 100644 --- a/Core/Core/Configuration/CSSInjector.swift +++ b/Core/Core/Configuration/CSSInjector.swift @@ -115,7 +115,7 @@ public class CSSInjector {