From 5d435c005efd73420e81276919ac87d45f5396ac Mon Sep 17 00:00:00 2001 From: Girish Date: Tue, 13 Jan 2026 18:32:12 +0530 Subject: [PATCH 1/2] background clor update --- .../InstantOnboardingView.swift | 4 +- .../Controller/AllMediaViewController.swift | 352 ++++++++++++++---- .../BackupTransferViewController.swift | 1 + .../ConnectivityViewController.swift | 181 +++++++-- .../Controller/EditContactController.swift | 20 + .../Controller/FilesViewController.swift | 1 + .../Controller/HelpViewController.swift | 183 +++++++-- .../Controller/ProfileViewController.swift | 1 + .../Controller/QrViewController.swift | 2 +- .../Settings/AdvancedViewController.swift | 1 + .../ChatsAndMediaViewController.swift | 2 + .../NotificationsViewController.swift | 1 + .../Settings/SelfProfileViewController.swift | 1 + .../Settings/SettingsViewController.swift | 22 +- 14 files changed, 632 insertions(+), 140 deletions(-) diff --git a/deltachat-ios/Controller/AccountSetup/Instand Onboarding/InstantOnboardingView.swift b/deltachat-ios/Controller/AccountSetup/Instand Onboarding/InstantOnboardingView.swift index 339313ac1..2968313fc 100644 --- a/deltachat-ios/Controller/AccountSetup/Instand Onboarding/InstantOnboardingView.swift +++ b/deltachat-ios/Controller/AccountSetup/Instand Onboarding/InstantOnboardingView.swift @@ -92,8 +92,10 @@ class InstantOnboardingView: UIView { contentScrollView.keyboardDismissMode = .onDrag super.init(frame: .zero) + + backgroundColor = DcColors.chatBackgroundColor + contentScrollView.backgroundColor = DcColors.chatBackgroundColor - backgroundColor = .systemBackground nameTextField.backgroundColor = .secondarySystemBackground addSubview(contentScrollView) diff --git a/deltachat-ios/Controller/AllMediaViewController.swift b/deltachat-ios/Controller/AllMediaViewController.swift index 4e8ee1170..a36053b3e 100644 --- a/deltachat-ios/Controller/AllMediaViewController.swift +++ b/deltachat-ios/Controller/AllMediaViewController.swift @@ -1,8 +1,180 @@ +//import UIKit +//import DcCore +// +//class AllMediaViewController: UIPageViewController { +// +// private struct Page { +// let headerTitle: String +// let type1: Int32 +// let type2: Int32 +// let type3: Int32 +// } +// +// private let dcContext: DcContext +// private let chatId: Int +// private var prevIndex: Int = 0 +// +// private var pages: [Page] = [ +// Page( +// headerTitle: String.localized("webxdc_apps"), +// type1: DC_MSG_WEBXDC, type2: 0, type3: 0 +// ), +// Page( +// headerTitle: String.localized("gallery"), +// type1: DC_MSG_IMAGE, type2: DC_MSG_GIF, type3: DC_MSG_VIDEO +// ), +// Page( +// headerTitle: String.localized("files"), +// type1: DC_MSG_FILE, type2: 0, type3: 0 +// ), +// Page( +// headerTitle: String.localized("audio"), +// type1: DC_MSG_AUDIO, type2: DC_MSG_VOICE, type3: 0 +// )] +// +// private lazy var segmentControl: UISegmentedControl = { +// let control = UISegmentedControl(items: pages.map({ $0.headerTitle })) +// +// // Background color for the entire control +// // control.backgroundColor = DcColors.whiteBackgroundColor +// +// // Color for the selected segment +// control.selectedSegmentTintColor = DcColors.privittyThemeColor +// +// // Text color for normal (unselected) segments +// let normalTextAttributes: [NSAttributedString.Key: Any] = [ +// .foregroundColor: DcColors.defaultInverseColor, +// .font: AppFont.medium(size: 14) +// ] +// control.setTitleTextAttributes(normalTextAttributes, for: .normal) +// +// // Text color for selected segment +// let selectedTextAttributes: [NSAttributedString.Key: Any] = [ +// .foregroundColor: DcColors.defaultBackgroundColor, +// .font: AppFont.medium(size: 14) +// ] +// control.setTitleTextAttributes(selectedTextAttributes, for: .selected) +// +// control.layer.cornerRadius = 8 +// control.clipsToBounds = true +// +// control.addTarget(self, action: #selector(segmentControlChanged), for: .valueChanged) +// control.selectedSegmentIndex = 0 +// return control +// }() +// +// private lazy var mapButton: UIBarButtonItem = { +// return UIBarButtonItem(image: UIImage(systemName: "map"), style: .plain, target: self, action: #selector(showMap)) +// }() +// +// init(dcContext: DcContext, chatId: Int = 0) { +// self.dcContext = dcContext +// self.chatId = chatId +// super.init(transitionStyle: .scroll, navigationOrientation: .horizontal, options: [:]) +// hidesBottomBarWhenPushed = true +// } +// +// required init?(coder: NSCoder) { +// fatalError("init(coder:) has not been implemented") +// } +// +// // MARK: - lifecycle +// override func viewDidLoad() { +// super.viewDidLoad() +// dataSource = self +// delegate = self +// navigationItem.titleView = segmentControl +// navigationItem.rightBarButtonItem = UserDefaults.standard.bool(forKey: "location_streaming") ? mapButton : nil +// navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance +// +// let page = pages[prevIndex] +// setViewControllers([makeViewController(page)], direction: .forward, animated: false, completion: nil) +// segmentControl.selectedSegmentIndex = prevIndex +// } +// +// @objc private func backTapped() { +// navigationController?.popViewController(animated: true) +// } +// +// // MARK: - actions +// @objc private func segmentControlChanged(_ sender: UISegmentedControl) { +// if sender.selectedSegmentIndex < pages.count { +// let page = pages[sender.selectedSegmentIndex] +// setViewControllers([makeViewController(page)], +// direction: sender.selectedSegmentIndex > prevIndex ? .forward : .reverse, animated: true, completion: nil) +// prevIndex = sender.selectedSegmentIndex +// } +// } +// +// @objc private func showMap() { +// navigationController?.pushViewController(MapViewController(dcContext: dcContext, chatId: chatId), animated: true) +// } +// +// // MARK: - factory +// private func makeViewController(_ page: Page) -> UIViewController { +// if page.type1 == DC_MSG_IMAGE { +// return GalleryViewController(context: dcContext, chatId: chatId) +// } else { +// return FilesViewController(context: dcContext, chatId: chatId, type1: page.type1, type2: page.type2, type3: page.type3) +// } +// } +//} +// +//// MARK: - UIPageViewControllerDataSource, UIPageViewControllerDelegate +//extension AllMediaViewController: UIPageViewControllerDataSource, UIPageViewControllerDelegate { +// func getIndexFromObject(_ viewController: UIViewController) -> Int { +// let type1: Int32 +// if let filesViewContoller = viewController as? FilesViewController { +// type1 = filesViewContoller.type1 +// } else { +// type1 = DC_MSG_IMAGE +// } +// for (index, page) in pages.enumerated() { +// if page.type1 == type1 { +// return index +// } +// } +// return 0 +// } +// +// func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? { +// let i = getIndexFromObject(viewController) +// if i > 0 { +// return makeViewController(pages[i - 1]) +// } +// return nil +// } +// +// func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { +// let i = getIndexFromObject(viewController) +// if i < (pages.count - 1) { +// return makeViewController(pages[i + 1]) +// } +// return nil +// } +// +// func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) { +// if let viewController = pendingViewControllers.first { +// let i = getIndexFromObject(viewController) +// segmentControl.selectedSegmentIndex = i +// prevIndex = i +// } +// } +// +// func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { +// if let viewController = previousViewControllers.first, !completed { +// let i = getIndexFromObject(viewController) +// segmentControl.selectedSegmentIndex = i +// prevIndex = i +// } +// } +//} import UIKit import DcCore -class AllMediaViewController: UIPageViewController { +final class AllMediaViewController: UIPageViewController { + // MARK: - Page model private struct Page { let headerTitle: String let type1: Int32 @@ -10,11 +182,12 @@ class AllMediaViewController: UIPageViewController { let type3: Int32 } + // MARK: - Properties private let dcContext: DcContext private let chatId: Int private var prevIndex: Int = 0 - private var pages: [Page] = [ + private let pages: [Page] = [ Page( headerTitle: String.localized("webxdc_apps"), type1: DC_MSG_WEBXDC, type2: 0, type3: 0 @@ -30,25 +203,21 @@ class AllMediaViewController: UIPageViewController { Page( headerTitle: String.localized("audio"), type1: DC_MSG_AUDIO, type2: DC_MSG_VOICE, type3: 0 - )] - - private lazy var segmentControl: UISegmentedControl = { - let control = UISegmentedControl(items: pages.map({ $0.headerTitle })) + ) + ] - // Background color for the entire control - // control.backgroundColor = DcColors.whiteBackgroundColor + // MARK: - Segmented Control + private lazy var segmentControl: UISegmentedControl = { + let control = UISegmentedControl(items: pages.map { $0.headerTitle }) - // Color for the selected segment control.selectedSegmentTintColor = DcColors.privittyThemeColor - // Text color for normal (unselected) segments let normalTextAttributes: [NSAttributedString.Key: Any] = [ .foregroundColor: DcColors.defaultInverseColor, .font: AppFont.medium(size: 14) ] control.setTitleTextAttributes(normalTextAttributes, for: .normal) - // Text color for selected segment let selectedTextAttributes: [NSAttributedString.Key: Any] = [ .foregroundColor: DcColors.defaultBackgroundColor, .font: AppFont.medium(size: 14) @@ -57,20 +226,30 @@ class AllMediaViewController: UIPageViewController { control.layer.cornerRadius = 8 control.clipsToBounds = true - - control.addTarget(self, action: #selector(segmentControlChanged), for: .valueChanged) control.selectedSegmentIndex = 0 + control.addTarget(self, action: #selector(segmentControlChanged), for: .valueChanged) return control }() + // MARK: - Map Button private lazy var mapButton: UIBarButtonItem = { - return UIBarButtonItem(image: UIImage(systemName: "map"), style: .plain, target: self, action: #selector(showMap)) + UIBarButtonItem( + image: UIImage(systemName: "map"), + style: .plain, + target: self, + action: #selector(showMap) + ) }() + // MARK: - Init init(dcContext: DcContext, chatId: Int = 0) { self.dcContext = dcContext self.chatId = chatId - super.init(transitionStyle: .scroll, navigationOrientation: .horizontal, options: [:]) + super.init( + transitionStyle: .scroll, + navigationOrientation: .horizontal, + options: nil + ) hidesBottomBarWhenPushed = true } @@ -78,92 +257,133 @@ class AllMediaViewController: UIPageViewController { fatalError("init(coder:) has not been implemented") } - // MARK: - lifecycle + // MARK: - Lifecycle override func viewDidLoad() { super.viewDidLoad() + + view.backgroundColor = DcColors.chatBackgroundColor + + for subview in view.subviews { + if let scrollView = subview as? UIScrollView { + scrollView.backgroundColor = DcColors.chatBackgroundColor + } + } + dataSource = self delegate = self + navigationItem.titleView = segmentControl - navigationItem.rightBarButtonItem = UserDefaults.standard.bool(forKey: "location_streaming") ? mapButton : nil - navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance - + navigationItem.rightBarButtonItem = + UserDefaults.standard.bool(forKey: "location_streaming") ? mapButton : nil + + navigationController?.navigationBar.scrollEdgeAppearance = + navigationController?.navigationBar.standardAppearance + let page = pages[prevIndex] - setViewControllers([makeViewController(page)], direction: .forward, animated: false, completion: nil) + setViewControllers( + [makeViewController(page)], + direction: .forward, + animated: false + ) + segmentControl.selectedSegmentIndex = prevIndex } - - @objc private func backTapped() { - navigationController?.popViewController(animated: true) - } - // MARK: - actions + // MARK: - Actions @objc private func segmentControlChanged(_ sender: UISegmentedControl) { - if sender.selectedSegmentIndex < pages.count { - let page = pages[sender.selectedSegmentIndex] - setViewControllers([makeViewController(page)], - direction: sender.selectedSegmentIndex > prevIndex ? .forward : .reverse, animated: true, completion: nil) - prevIndex = sender.selectedSegmentIndex - } + let index = sender.selectedSegmentIndex + guard index < pages.count else { return } + + let direction: UIPageViewController.NavigationDirection = + index > prevIndex ? .forward : .reverse + + prevIndex = index + setViewControllers( + [makeViewController(pages[index])], + direction: direction, + animated: true + ) } @objc private func showMap() { - navigationController?.pushViewController(MapViewController(dcContext: dcContext, chatId: chatId), animated: true) + navigationController?.pushViewController( + MapViewController(dcContext: dcContext, chatId: chatId), + animated: true + ) } - // MARK: - factory + // MARK: - Factory private func makeViewController(_ page: Page) -> UIViewController { + let vc: UIViewController + if page.type1 == DC_MSG_IMAGE { - return GalleryViewController(context: dcContext, chatId: chatId) + vc = GalleryViewController( + context: dcContext, + chatId: chatId + ) } else { - return FilesViewController(context: dcContext, chatId: chatId, type1: page.type1, type2: page.type2, type3: page.type3) + vc = FilesViewController( + context: dcContext, + chatId: chatId, + type1: page.type1, + type2: page.type2, + type3: page.type3 + ) } + + vc.view.backgroundColor = DcColors.chatBackgroundColor + return vc } } -// MARK: - UIPageViewControllerDataSource, UIPageViewControllerDelegate +// MARK: - UIPageViewControllerDataSource & Delegate extension AllMediaViewController: UIPageViewControllerDataSource, UIPageViewControllerDelegate { - func getIndexFromObject(_ viewController: UIViewController) -> Int { + + private func index(for viewController: UIViewController) -> Int { let type1: Int32 - if let filesViewContoller = viewController as? FilesViewController { - type1 = filesViewContoller.type1 + if let filesVC = viewController as? FilesViewController { + type1 = filesVC.type1 } else { type1 = DC_MSG_IMAGE } - for (index, page) in pages.enumerated() { - if page.type1 == type1 { - return index - } - } - return 0 + + return pages.firstIndex { $0.type1 == type1 } ?? 0 } - func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? { - let i = getIndexFromObject(viewController) - if i > 0 { - return makeViewController(pages[i - 1]) - } - return nil + func pageViewController( + _ pageViewController: UIPageViewController, + viewControllerBefore viewController: UIViewController + ) -> UIViewController? { + let i = index(for: viewController) + return i > 0 ? makeViewController(pages[i - 1]) : nil } - func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? { - let i = getIndexFromObject(viewController) - if i < (pages.count - 1) { - return makeViewController(pages[i + 1]) - } - return nil + func pageViewController( + _ pageViewController: UIPageViewController, + viewControllerAfter viewController: UIViewController + ) -> UIViewController? { + let i = index(for: viewController) + return i < pages.count - 1 ? makeViewController(pages[i + 1]) : nil } - func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) { - if let viewController = pendingViewControllers.first { - let i = getIndexFromObject(viewController) - segmentControl.selectedSegmentIndex = i - prevIndex = i - } + func pageViewController( + _ pageViewController: UIPageViewController, + willTransitionTo pendingViewControllers: [UIViewController] + ) { + guard let vc = pendingViewControllers.first else { return } + let i = index(for: vc) + segmentControl.selectedSegmentIndex = i + prevIndex = i } - func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { - if let viewController = previousViewControllers.first, !completed { - let i = getIndexFromObject(viewController) + func pageViewController( + _ pageViewController: UIPageViewController, + didFinishAnimating finished: Bool, + previousViewControllers: [UIViewController], + transitionCompleted completed: Bool + ) { + if !completed, let vc = previousViewControllers.first { + let i = index(for: vc) segmentControl.selectedSegmentIndex = i prevIndex = i } diff --git a/deltachat-ios/Controller/BackupTransferViewController.swift b/deltachat-ios/Controller/BackupTransferViewController.swift index 07e6455b2..02c513cbe 100644 --- a/deltachat-ios/Controller/BackupTransferViewController.swift +++ b/deltachat-ios/Controller/BackupTransferViewController.swift @@ -85,6 +85,7 @@ class BackupTransferViewController: UIViewController { super.viewDidLoad() navigationItem.leftBarButtonItem = cancelButton updateMenuItems() + view.backgroundColor = DcColors.chatBackgroundColor triggerLocalNetworkPrivacyAlert() diff --git a/deltachat-ios/Controller/ConnectivityViewController.swift b/deltachat-ios/Controller/ConnectivityViewController.swift index f2044d3be..9ac96ebc2 100644 --- a/deltachat-ios/Controller/ConnectivityViewController.swift +++ b/deltachat-ios/Controller/ConnectivityViewController.swift @@ -1,70 +1,177 @@ +//import UIKit +//import DcCore +//import Network +// +//class ConnectivityViewController: WebViewViewController { +// +// override init(dcContext: DcContext) { +// super.init(dcContext: dcContext) +// +// // set connectivity changed observer before we actually init html, +// // otherwise, we may miss events and the html is not correct. +// NotificationCenter.default.addObserver(self, selector: #selector(ConnectivityViewController.handleConnectivityChanged(_:)), name: Event.connectivityChanged, object: nil) +// } +// +// required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } +// +// // called only once after loading +// override func viewDidLoad() { +// super.viewDidLoad() +// self.title = String.localized("connectivity") +// self.webView.scrollView.bounces = false +// self.webView.isOpaque = false +// self.webView.backgroundColor = .clear +// view.backgroundColor = DcColors.defaultBackgroundColor +// } +// +// // called everytime the view will appear +// override func viewWillAppear(_ animated: Bool) { +// super.viewWillAppear(animated) +// loadHtml() +// } +// +// @objc private func handleConnectivityChanged(_ notification: Notification) { +// guard dcContext.id == notification.userInfo?["account_id"] as? Int else { return } +// +// loadHtml() +// } +// +// private func loadHtml() { +// DispatchQueue.global(qos: .userInitiated).async { [weak self] in +// guard let self else { return } +// let html = dcContext.getConnectivityHtml() +// .replacingOccurrences(of: "", with: +// """ +// body { +// font-size: 13pt; +// font-family: -apple-system, sans-serif; +// padding: 0 .5rem .5rem .5rem; +// -webkit-text-size-adjust: none; +// } +// +// .disabled { +// background-color: #aaaaaa; +// } +// +// @media (prefers-color-scheme: dark) { +// body { +// background-color: black !important; +// color: #eee; +// } +// } +// +// """) +// +// DispatchQueue.main.async { [weak self] in +// self?.webView.loadHTMLString(html, baseURL: nil) +// } +// } +// } +//} + import UIKit import DcCore import Network -class ConnectivityViewController: WebViewViewController { +final class ConnectivityViewController: WebViewViewController { + // MARK: - Init override init(dcContext: DcContext) { super.init(dcContext: dcContext) - // set connectivity changed observer before we actually init html, - // otherwise, we may miss events and the html is not correct. - NotificationCenter.default.addObserver(self, selector: #selector(ConnectivityViewController.handleConnectivityChanged(_:)), name: Event.connectivityChanged, object: nil) + // Observe connectivity changes early + NotificationCenter.default.addObserver( + self, + selector: #selector(handleConnectivityChanged(_:)), + name: Event.connectivityChanged, + object: nil + ) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") } - - required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - // called only once after loading + deinit { + NotificationCenter.default.removeObserver(self) + } + + // MARK: - Lifecycle override func viewDidLoad() { super.viewDidLoad() - self.title = String.localized("connectivity") - self.webView.scrollView.bounces = false - self.webView.isOpaque = false - self.webView.backgroundColor = .clear - view.backgroundColor = DcColors.defaultBackgroundColor + + title = String.localized("connectivity") + + // ✅ Root background + view.backgroundColor = DcColors.chatBackgroundColor + + // ✅ WebView setup + webView.isOpaque = false + webView.backgroundColor = .clear + webView.scrollView.backgroundColor = .clear + webView.scrollView.bounces = false + + // ✅ Navigation bar consistency + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = DcColors.chatBackgroundColor + appearance.titleTextAttributes = [ + .foregroundColor: DcColors.defaultInverseColor + ] + + navigationController?.navigationBar.standardAppearance = appearance + navigationController?.navigationBar.scrollEdgeAppearance = appearance } - - // called everytime the view will appear + + // Called every time the view appears override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) loadHtml() } + // MARK: - Connectivity Updates @objc private func handleConnectivityChanged(_ notification: Notification) { guard dcContext.id == notification.userInfo?["account_id"] as? Int else { return } - loadHtml() } + // MARK: - HTML Loading private func loadHtml() { DispatchQueue.global(qos: .userInitiated).async { [weak self] in guard let self else { return } - let html = dcContext.getConnectivityHtml() - .replacingOccurrences(of: "", with: - """ - body { - font-size: 13pt; - font-family: -apple-system, sans-serif; - padding: 0 .5rem .5rem .5rem; - -webkit-text-size-adjust: none; - } - - .disabled { - background-color: #aaaaaa; - } - - @media (prefers-color-scheme: dark) { - body { - background-color: black !important; - color: #eee; - } - } - - """) + + let html = self.dcContext + .getConnectivityHtml() + .replacingOccurrences(of: "", with: self.injectedCSS) DispatchQueue.main.async { [weak self] in self?.webView.loadHTMLString(html, baseURL: nil) } } } + + // MARK: - CSS Injection + private var injectedCSS: String { + """ + body { + font-size: 13pt; + font-family: -apple-system, BlinkMacSystemFont, sans-serif; + padding: 0 .5rem .5rem .5rem; + -webkit-text-size-adjust: none; + background-color: transparent; + } + + .disabled { + background-color: #aaaaaa; + } + + @media (prefers-color-scheme: dark) { + body { + background-color: transparent !important; + color: #eee; + } + } + + """ + } } diff --git a/deltachat-ios/Controller/EditContactController.swift b/deltachat-ios/Controller/EditContactController.swift index 91935a3fa..59df42643 100644 --- a/deltachat-ios/Controller/EditContactController.swift +++ b/deltachat-ios/Controller/EditContactController.swift @@ -26,6 +26,26 @@ class EditContactController: UITableViewController { navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .save, target: self, action: #selector(saveButtonPressed)) navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelButtonPressed)) } + override func viewDidLoad() { + super.viewDidLoad() + + tableView.backgroundColor = DcColors.chatBackgroundColor + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = DcColors.chatBackgroundColor + appearance.titleTextAttributes = [ + .foregroundColor: UIColor.label + ] + appearance.largeTitleTextAttributes = [ + .foregroundColor: UIColor.label + ] + + navigationController?.navigationBar.standardAppearance = appearance + navigationController?.navigationBar.scrollEdgeAppearance = appearance + navigationController?.navigationBar.compactAppearance = appearance + } + + required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") diff --git a/deltachat-ios/Controller/FilesViewController.swift b/deltachat-ios/Controller/FilesViewController.swift index 4f5dab949..6353eb4b3 100644 --- a/deltachat-ios/Controller/FilesViewController.swift +++ b/deltachat-ios/Controller/FilesViewController.swift @@ -66,6 +66,7 @@ class FilesViewController: UIViewController { // MARK: - lifecycle override func viewDidLoad() { + view.backgroundColor = DcColors.chatBackgroundColor super.viewDidLoad() setupSubviews() DispatchQueue.global(qos: .userInteractive).async { [weak self] in diff --git a/deltachat-ios/Controller/HelpViewController.swift b/deltachat-ios/Controller/HelpViewController.swift index 4efa97ed8..1bfb28d59 100644 --- a/deltachat-ios/Controller/HelpViewController.swift +++ b/deltachat-ios/Controller/HelpViewController.swift @@ -1,11 +1,108 @@ +//import UIKit +//import WebKit +//import DcCore +// +//class HelpViewController: WebViewViewController { +// +// let fragment: String? +// +// init(dcContext: DcContext, fragment: String? = nil) { +// self.fragment = fragment +// super.init(dcContext: dcContext) +// self.allowSearch = true +// } +// +// required init?(coder: NSCoder) { +// fatalError("init(coder:) has not been implemented") +// } +// +// private lazy var moreButton: UIBarButtonItem = { +// let image = UIImage(systemName: "ellipsis.circle") +// return UIBarButtonItem(image: image, menu: moreButtonMenu()) +// }() +// +// override func viewDidLoad() { +// super.viewDidLoad() +// self.title = String.localized("menu_help") +// self.webView.isOpaque = false +// self.webView.backgroundColor = .clear +// view.backgroundColor = DcColors.defaultBackgroundColor +// navigationItem.rightBarButtonItem = moreButton +// } +// +// override func viewWillAppear(_ animated: Bool) { +// super.viewWillAppear(animated) +// loadHtmlContent { [weak self] url in +// // return to main thread +// DispatchQueue.main.async { +// self?.webView.loadFileURL(url, allowingReadAccessTo: url) +// } +// } +// } +// +// func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { +// if let fragment = self.fragment { +// let scrollToFragmentScript = "window.location.hash = '\(fragment)';" +// webView.evaluateJavaScript(scrollToFragmentScript, completionHandler: nil) +// } +// } +// +// private func loadHtmlContent(completionHandler: ((URL) -> Void)?) { +// // execute in background thread because file loading would blockui for a few milliseconds +// DispatchQueue.global(qos: .userInitiated).async { +// let langAndRegion = Locale.preferredLanguages.first ?? "en" +// let langOnly = String(langAndRegion.split(separator: "-").first ?? Substring("ErrLang")) +// var fileURL: URL? +// +// fileURL = Bundle.main.url(forResource: "help", withExtension: "html", subdirectory: "Assets/Help/\(langAndRegion)") ?? +// Bundle.main.url(forResource: "help", withExtension: "html", subdirectory: "Assets/Help/\(langOnly)") ?? +// Bundle.main.url(forResource: "help", withExtension: "html", subdirectory: "Assets/Help/en") +// +// guard let url = fileURL else { +// safe_fatalError("could not find help asset") +// return +// } +// completionHandler?(url) +// } +// } +// +// private func moreButtonMenu() -> UIMenu { +// let actions = [ +// UIAction(title: String.localized("delta_chat_homepage"), image: UIImage(systemName: "globe")) { _ in +// if let url = URL(string: "https://delta.chat") { +// UIApplication.shared.open(url) +// } +// }, +// UIAction(title: String.localized("privacy_policy"), image: UIImage(systemName: "hand.raised")) { _ in +// if let url = URL(string: "https://delta.chat/gdpr") { +// UIApplication.shared.open(url) +// } +// }, +// UIAction(title: String.localized("contribute"), image: UIImage(systemName: "wrench.and.screwdriver")) { _ in +// if let url = URL(string: "https://delta.chat/contribute") { +// UIApplication.shared.open(url) +// } +// }, +// UIAction(title: String.localized("global_menu_help_report_desktop"), image: UIImage(systemName: "ant")) { _ in +// if let url = URL(string: "https://github.com/deltachat/deltachat-ios/issues") { +// UIApplication.shared.open(url) +// } +// }, +// ] +// return UIMenu(children: actions) +// } +//} + import UIKit import WebKit import DcCore -class HelpViewController: WebViewViewController { +final class HelpViewController: WebViewViewController { - let fragment: String? + // MARK: - Properties + private let fragment: String? + // MARK: - Init init(dcContext: DcContext, fragment: String? = nil) { self.fragment = fragment super.init(dcContext: dcContext) @@ -16,45 +113,54 @@ class HelpViewController: WebViewViewController { fatalError("init(coder:) has not been implemented") } + // MARK: - UI private lazy var moreButton: UIBarButtonItem = { let image = UIImage(systemName: "ellipsis.circle") return UIBarButtonItem(image: image, menu: moreButtonMenu()) }() + // MARK: - Lifecycle override func viewDidLoad() { super.viewDidLoad() - self.title = String.localized("menu_help") - self.webView.isOpaque = false - self.webView.backgroundColor = .clear + + title = String.localized("menu_help") + view.backgroundColor = DcColors.defaultBackgroundColor + + webView.isOpaque = false + webView.backgroundColor = .clear + webView.scrollView.backgroundColor = .clear + navigationItem.rightBarButtonItem = moreButton } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + loadHtmlContent { [weak self] url in - // return to main thread DispatchQueue.main.async { self?.webView.loadFileURL(url, allowingReadAccessTo: url) } } } + // MARK: - WKNavigationDelegate hook (NOT override) func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { - if let fragment = self.fragment { - let scrollToFragmentScript = "window.location.hash = '\(fragment)';" - webView.evaluateJavaScript(scrollToFragmentScript, completionHandler: nil) - } + guard let fragment else { return } + + let script = "window.location.hash = '\(fragment)';" + webView.evaluateJavaScript(script, completionHandler: nil) } + // MARK: - HTML Loader private func loadHtmlContent(completionHandler: ((URL) -> Void)?) { - // execute in background thread because file loading would blockui for a few milliseconds DispatchQueue.global(qos: .userInitiated).async { + let langAndRegion = Locale.preferredLanguages.first ?? "en" - let langOnly = String(langAndRegion.split(separator: "-").first ?? Substring("ErrLang")) - var fileURL: URL? + let langOnly = String(langAndRegion.split(separator: "-").first ?? "en") - fileURL = Bundle.main.url(forResource: "help", withExtension: "html", subdirectory: "Assets/Help/\(langAndRegion)") ?? + let fileURL = + Bundle.main.url(forResource: "help", withExtension: "html", subdirectory: "Assets/Help/\(langAndRegion)") ?? Bundle.main.url(forResource: "help", withExtension: "html", subdirectory: "Assets/Help/\(langOnly)") ?? Bundle.main.url(forResource: "help", withExtension: "html", subdirectory: "Assets/Help/en") @@ -62,33 +168,46 @@ class HelpViewController: WebViewViewController { safe_fatalError("could not find help asset") return } + completionHandler?(url) } } + // MARK: - Menu private func moreButtonMenu() -> UIMenu { - let actions = [ - UIAction(title: String.localized("delta_chat_homepage"), image: UIImage(systemName: "globe")) { _ in - if let url = URL(string: "https://delta.chat") { - UIApplication.shared.open(url) - } - }, - UIAction(title: String.localized("privacy_policy"), image: UIImage(systemName: "hand.raised")) { _ in - if let url = URL(string: "https://delta.chat/gdpr") { - UIApplication.shared.open(url) - } + let actions: [UIAction] = [ + + UIAction( + title: String.localized("delta_chat_homepage"), + image: UIImage(systemName: "globe") + ) { _ in + UIApplication.shared.open(URL(string: "https://delta.chat")!) }, - UIAction(title: String.localized("contribute"), image: UIImage(systemName: "wrench.and.screwdriver")) { _ in - if let url = URL(string: "https://delta.chat/contribute") { - UIApplication.shared.open(url) - } + + UIAction( + title: String.localized("privacy_policy"), + image: UIImage(systemName: "hand.raised") + ) { _ in + UIApplication.shared.open(URL(string: "https://delta.chat/gdpr")!) }, - UIAction(title: String.localized("global_menu_help_report_desktop"), image: UIImage(systemName: "ant")) { _ in - if let url = URL(string: "https://github.com/deltachat/deltachat-ios/issues") { - UIApplication.shared.open(url) - } + + UIAction( + title: String.localized("contribute"), + image: UIImage(systemName: "wrench.and.screwdriver") + ) { _ in + UIApplication.shared.open(URL(string: "https://delta.chat/contribute")!) }, + + UIAction( + title: String.localized("global_menu_help_report_desktop"), + image: UIImage(systemName: "ant") + ) { _ in + UIApplication.shared.open( + URL(string: "https://github.com/deltachat/deltachat-ios/issues")! + ) + } ] + return UIMenu(children: actions) } } diff --git a/deltachat-ios/Controller/ProfileViewController.swift b/deltachat-ios/Controller/ProfileViewController.swift index f07786bfd..ecbec0361 100644 --- a/deltachat-ios/Controller/ProfileViewController.swift +++ b/deltachat-ios/Controller/ProfileViewController.swift @@ -149,6 +149,7 @@ class ProfileViewController: UITableViewController { // MARK: - lifecycle override func viewDidLoad() { + view.backgroundColor = DcColors.chatBackgroundColor super.viewDidLoad() tableView.register(ActionCell.self, forCellReuseIdentifier: ActionCell.reuseIdentifier) tableView.register(ContactCell.self, forCellReuseIdentifier: ContactCell.reuseIdentifier) diff --git a/deltachat-ios/Controller/QrViewController.swift b/deltachat-ios/Controller/QrViewController.swift index a5a8ab74a..af8efebda 100644 --- a/deltachat-ios/Controller/QrViewController.swift +++ b/deltachat-ios/Controller/QrViewController.swift @@ -55,7 +55,7 @@ class QrViewController: UIViewController { super.init(nibName: nil, bundle: nil) - view.backgroundColor = DcColors.defaultBackgroundColor + view.backgroundColor = DcColors.chatBackgroundColor title = String.localized("qrshow_title") navigationItem.rightBarButtonItem = moreButton diff --git a/deltachat-ios/Controller/Settings/AdvancedViewController.swift b/deltachat-ios/Controller/Settings/AdvancedViewController.swift index 0adf6bce9..baa130475 100644 --- a/deltachat-ios/Controller/Settings/AdvancedViewController.swift +++ b/deltachat-ios/Controller/Settings/AdvancedViewController.swift @@ -252,6 +252,7 @@ internal final class AdvancedViewController: UITableViewController { super.viewDidLoad() title = String.localized("menu_advanced") tableView.rowHeight = UITableView.automaticDimension + view.backgroundColor = DcColors.chatBackgroundColor } override func viewWillAppear(_ animated: Bool) { diff --git a/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift b/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift index f604ac008..6482fda5d 100644 --- a/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift +++ b/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift @@ -140,6 +140,8 @@ internal final class ChatsAndMediaViewController: UITableViewController { super.viewDidLoad() title = String.localized("pref_chats") tableView.rowHeight = UITableView.automaticDimension + view.backgroundColor = DcColors.chatBackgroundColor + } override func viewWillAppear(_ animated: Bool) { diff --git a/deltachat-ios/Controller/Settings/NotificationsViewController.swift b/deltachat-ios/Controller/Settings/NotificationsViewController.swift index 88f042612..ac43f1994 100644 --- a/deltachat-ios/Controller/Settings/NotificationsViewController.swift +++ b/deltachat-ios/Controller/Settings/NotificationsViewController.swift @@ -126,6 +126,7 @@ internal final class NotificationsViewController: UITableViewController { super.viewDidLoad() title = String.localized("pref_notifications") tableView.rowHeight = UITableView.automaticDimension + view.backgroundColor = DcColors.chatBackgroundColor } override func viewWillAppear(_ animated: Bool) { diff --git a/deltachat-ios/Controller/Settings/SelfProfileViewController.swift b/deltachat-ios/Controller/Settings/SelfProfileViewController.swift index b01b09168..6070903f0 100644 --- a/deltachat-ios/Controller/Settings/SelfProfileViewController.swift +++ b/deltachat-ios/Controller/Settings/SelfProfileViewController.swift @@ -69,6 +69,7 @@ class SelfProfileViewController: UITableViewController, MediaPickerDelegate { override func viewDidLoad() { super.viewDidLoad() + view.backgroundColor = DcColors.chatBackgroundColor title = String.localized("pref_profile_info_headline") avatarSelectionCell.onAvatarTapped = { [weak self] in self?.onAvatarTapped() diff --git a/deltachat-ios/Controller/Settings/SettingsViewController.swift b/deltachat-ios/Controller/Settings/SettingsViewController.swift index 4d9323653..64f03118e 100644 --- a/deltachat-ios/Controller/Settings/SettingsViewController.swift +++ b/deltachat-ios/Controller/Settings/SettingsViewController.swift @@ -152,17 +152,31 @@ internal final class SettingsViewController: UITableViewController { required init?(coder _: NSCoder) { fatalError("init(coder:) has not been implemented") } - - // MARK: - lifecycle + override func viewDidLoad() { super.viewDidLoad() title = String.localized("menu_settings") tableView.rowHeight = UITableView.automaticDimension tableView.separatorStyle = .none - tableView.backgroundColor = .clear + + // Set the main backgrounds to red + view.backgroundColor = DcColors.chatBackgroundColor + tableView.backgroundColor = DcColors.chatBackgroundColor } + // MARK: - lifecycle +// override func viewDidLoad() { +// super.viewDidLoad() +// title = String.localized("menu_settings") +// tableView.rowHeight = UITableView.automaticDimension +// +// tableView.separatorStyle = .none +// view.backgroundColor = DcColors.chatBackgroundColor +// tableView.backgroundColor = DcColors.chatBackgroundColor +// tableView.backgroundColor = .clear +// } + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) notificationCell.detailTextLabel?.text = " " // nil does not reserve space for the warning calculated in background @@ -220,6 +234,8 @@ internal final class SettingsViewController: UITableViewController { } override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { + cell.backgroundColor = DcColors.chatBackgroundColor + cell.contentView.backgroundColor = DcColors.chatBackgroundColor switch indexPath.section { case 0: From 5d7f1f0d6cfc27f0af65f0cdb147d0679101aabc Mon Sep 17 00:00:00 2001 From: Girish Date: Sat, 17 Jan 2026 11:04:42 +0530 Subject: [PATCH 2/2] Apply Poppins font --- deltachat-ios.xcodeproj/project.pbxproj | 4 +++ deltachat-ios/Assets/Help/help.css | 2 +- deltachat-ios/Chat/ChatViewController.swift | 16 +++++++++ .../InputBarAccessoryView/InputTextView.swift | 3 +- .../Chat/Views/AudioPlayerView.swift | 3 +- .../Chat/Views/Cells/InfoMessageCell.swift | 3 +- .../Chat/Views/Cells/VideoInviteCell.swift | 6 ++-- .../Chat/Views/ChatContactRequestBar.swift | 3 +- .../Chat/Views/ContactCardView.swift | 6 ++-- deltachat-ios/Chat/Views/FileView.swift | 12 ++++--- deltachat-ios/Chat/Views/StatusView.swift | 6 ++-- .../InstantOnboardingView.swift | 8 +++-- .../AccountSetup/WelcomeViewController.swift | 11 +++--- .../Controller/AllMediaViewController.swift | 4 +-- .../BackupTransferViewController.swift | 4 +-- .../Controller/ChatListViewController.swift | 18 ++++++++++ .../ConnectivityViewController.swift | 5 +-- .../ContentDetailsViewController.swift | 19 ++++++---- .../Controller/EditContactController.swift | 1 - .../FileAccessControlViewController.swift | 18 ++++++---- .../FileAccessRequestBottomSheet.swift | 14 ++++---- .../FileAttachmentOptionsBottomSheet.swift | 14 ++++---- .../GroupMembersViewController.swift | 17 +++++++++ .../Controller/HelpViewController.swift | 9 +++++ .../Controller/NewChatViewController.swift | 18 ++++++++++ .../Controller/QrCodeReaderController.swift | 3 +- .../Controller/QrPageController.swift | 13 ++++++- .../Settings/AdvancedViewController.swift | 8 +++++ .../AutodelOptionsViewController.swift | 4 +++ .../AutodelOverviewViewController.swift | 10 ++++++ .../BackgroundOptionsViewController.swift | 4 +-- .../ChatsAndMediaViewController.swift | 16 +++++++++ .../DownloadOnDemandViewController.swift | 8 +++++ .../Settings/EmailOptionsViewController.swift | 9 +++++ .../Settings/MediaQualityViewController.swift | 8 +++++ .../Settings/Proxy/ProxyTableViewCell.swift | 8 +++-- .../Proxy/ShareProxyViewController.swift | 5 ++- .../Settings/SettingsViewController.swift | 15 ++++++++ .../VideoChatInstanceViewController.swift | 18 ++++++++++ .../Coordinator/AppCoordinator.swift | 10 +++++- deltachat-ios/Extensions/UIFont+Poppins.swift | 35 +++++++++++++++++++ deltachat-ios/View/ActionCell.swift | 2 ++ deltachat-ios/View/AvatarSelectionCell.swift | 3 +- deltachat-ios/View/Cell/GalleryCell.swift | 3 +- deltachat-ios/View/ChatTitleView.swift | 9 +++-- deltachat-ios/View/ContactCell.swift | 25 +++++++------ deltachat-ios/View/InitialsBadge.swift | 1 + deltachat-ios/View/MultilineLabelCell.swift | 7 ++-- .../View/MultilineTextFieldCell.swift | 6 ++-- deltachat-ios/View/ProfileHeader.swift | 5 +-- deltachat-ios/View/ProviderInfoCell.swift | 6 ++-- deltachat-ios/View/SwitchCell.swift | 4 ++- deltachat-ios/View/TextFieldCell.swift | 4 +-- 53 files changed, 381 insertions(+), 92 deletions(-) create mode 100644 deltachat-ios/Extensions/UIFont+Poppins.swift diff --git a/deltachat-ios.xcodeproj/project.pbxproj b/deltachat-ios.xcodeproj/project.pbxproj index f9a3207c3..03314bbd4 100644 --- a/deltachat-ios.xcodeproj/project.pbxproj +++ b/deltachat-ios.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 0D481EC62ED3EEF700CFB244 /* poppins_semibold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0D481EC32ED3EEF700CFB244 /* poppins_semibold.ttf */; }; 0D481EC72ED3EEF700CFB244 /* poppins_regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0D481EC22ED3EEF700CFB244 /* poppins_regular.ttf */; }; 0D481EC92ED3F1EB00CFB244 /* AppFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D481EC82ED3F1EB00CFB244 /* AppFont.swift */; }; + F00DABCD1234567890ABCDE0 /* UIFont+Poppins.swift in Sources */ = {isa = PBXBuildFile; fileRef = F00DABCD1234567890ABCDEF /* UIFont+Poppins.swift */; }; 0DACEEFC2EE47A7400043D27 /* ContentDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DACEEFB2EE47A7400043D27 /* ContentDetailsViewController.swift */; }; 0DACEF672EE4A7C600043D27 /* ContentDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DACEF662EE4A7C600043D27 /* ContentDetailsViewController.swift */; }; 21D54500299415B9008B54D5 /* Character+Extentions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D544FF299415B9008B54D5 /* Character+Extentions.swift */; }; @@ -329,6 +330,7 @@ 0D481EC22ED3EEF700CFB244 /* poppins_regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = poppins_regular.ttf; sourceTree = ""; }; 0D481EC32ED3EEF700CFB244 /* poppins_semibold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = poppins_semibold.ttf; sourceTree = ""; }; 0D481EC82ED3F1EB00CFB244 /* AppFont.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppFont.swift; sourceTree = ""; }; + F00DABCD1234567890ABCDEF /* UIFont+Poppins.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+Poppins.swift"; sourceTree = ""; }; 0DACEEFB2EE47A7400043D27 /* ContentDetailsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentDetailsViewController.swift; sourceTree = ""; }; 0DACEF662EE4A7C600043D27 /* ContentDetailsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentDetailsViewController.swift; sourceTree = ""; }; 0EEC8C8D7C6F411BA7A449DE /* Pods-deltachat-ios.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-deltachat-ios.debug.xcconfig"; path = "Target Support Files/Pods-deltachat-ios/Pods-deltachat-ios.debug.xcconfig"; sourceTree = ""; }; @@ -843,6 +845,7 @@ 6430531C2DF0668600E26D1F /* NSItemProvider+Extensions.swift */, 5F4945AA2D315E7000DCD50A /* UIPasteboard.swift */, C330030B2EB8D3E100A1AEDE /* UITableViewCell+Extension.swift */, + F00DABCD1234567890ABCDEF /* UIFont+Poppins.swift */, ); path = Extensions; sourceTree = ""; @@ -1903,6 +1906,7 @@ D8E426D82D423FCF0078C735 /* DownloadingActivityView.swift in Sources */, AEFBE22F23FEF23D0045327A /* ProviderInfoCell.swift in Sources */, C330030C2EB8D3E100A1AEDE /* UITableViewCell+Extension.swift in Sources */, + F00DABCD1234567890ABCDE0 /* UIFont+Poppins.swift in Sources */, AE6EC5242497663200A400E4 /* UIImageView+Extensions.swift in Sources */, 30F8817624DA97DA0023780E /* BackgroundContainer.swift in Sources */, 3067AA4C2666310E00525036 /* ChatInputTextView.swift in Sources */, diff --git a/deltachat-ios/Assets/Help/help.css b/deltachat-ios/Assets/Help/help.css index 9d4a45f3b..bf768e38c 100644 --- a/deltachat-ios/Assets/Help/help.css +++ b/deltachat-ios/Assets/Help/help.css @@ -1,6 +1,6 @@ body { font-size: 13pt; - font-family: -apple-system, sans-serif; + font-family: 'Poppins', -apple-system, sans-serif; padding: 0 .5rem .5rem .5rem; -webkit-text-size-adjust: none; } diff --git a/deltachat-ios/Chat/ChatViewController.swift b/deltachat-ios/Chat/ChatViewController.swift index d993feb4b..e39be9d63 100644 --- a/deltachat-ios/Chat/ChatViewController.swift +++ b/deltachat-ios/Chat/ChatViewController.swift @@ -42,6 +42,22 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate { searchController.searchBar.inputAccessoryView = messageInputBar searchController.searchBar.autocorrectionType = .yes searchController.searchBar.keyboardType = .default + + if #available(iOS 13.0, *) { + let textField = searchController.searchBar.searchTextField + textField.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + + if let placeholder = textField.placeholder { + textField.attributedPlaceholder = NSAttributedString( + string: placeholder, + attributes: [ + .font: UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular), + .foregroundColor: UIColor.secondaryLabel + ] + ) + } + } + return searchController }() diff --git a/deltachat-ios/Chat/InputBarAccessoryView/InputTextView.swift b/deltachat-ios/Chat/InputBarAccessoryView/InputTextView.swift index c312e2774..e128fadb7 100755 --- a/deltachat-ios/Chat/InputBarAccessoryView/InputTextView.swift +++ b/deltachat-ios/Chat/InputBarAccessoryView/InputTextView.swift @@ -163,7 +163,8 @@ open class InputTextView: UITextView { open func setup() { backgroundColor = .clear - font = UIFont.preferredFont(forTextStyle: .body) +// font = UIFont.preferredFont(forTextStyle: .body) + font = UIFont.poppins(forTextStyle: .body, weight: .regular) isScrollEnabled = false scrollIndicatorInsets = UIEdgeInsets(top: .leastNonzeroMagnitude, left: .leastNonzeroMagnitude, diff --git a/deltachat-ios/Chat/Views/AudioPlayerView.swift b/deltachat-ios/Chat/Views/AudioPlayerView.swift index 6d1a9e2be..0836589d8 100644 --- a/deltachat-ios/Chat/Views/AudioPlayerView.swift +++ b/deltachat-ios/Chat/Views/AudioPlayerView.swift @@ -31,7 +31,8 @@ open class AudioPlayerView: UIView { private lazy var durationLabel: UILabel = { let durationLabel = UILabel(frame: CGRect.zero) durationLabel.textAlignment = .right - durationLabel.font = UIFont.preferredFont(forTextStyle: .body) + durationLabel.font = UIFont.poppins(forTextStyle: .body, weight: .regular) +// durationLabel.font = UIFont.preferredFont(forTextStyle: .body) durationLabel.adjustsFontForContentSizeCategory = true durationLabel.text = "0:00" durationLabel.translatesAutoresizingMaskIntoConstraints = false diff --git a/deltachat-ios/Chat/Views/Cells/InfoMessageCell.swift b/deltachat-ios/Chat/Views/Cells/InfoMessageCell.swift index ee6302e8b..2a29fc33e 100644 --- a/deltachat-ios/Chat/Views/Cells/InfoMessageCell.swift +++ b/deltachat-ios/Chat/Views/Cells/InfoMessageCell.swift @@ -103,7 +103,8 @@ class InfoMessageCell: UITableViewCell, ReusableCell { ]) imageHeightConstraint = iconView.constraintHeightTo(0, priority: .required) - imageSize = UIFont.preferredFont(for: .subheadline, weight: .medium).pointSize + imageSize = UIFont.poppins(forTextStyle: .subheadline, weight: .medium).pointSize +// imageSize = UIFont.preferredFont(for: .subheadline, weight: .medium).pointSize imageHeightConstraint?.isActive = true trailingConstraint = messageLabel.constraintAlignTrailingMaxTo(contentView, paddingTrailing: 55) trailingConstraintEditingMode = messageLabel.constraintAlignTrailingMaxTo(contentView, paddingTrailing: 10) diff --git a/deltachat-ios/Chat/Views/Cells/VideoInviteCell.swift b/deltachat-ios/Chat/Views/Cells/VideoInviteCell.swift index 0db915464..c2c859d91 100644 --- a/deltachat-ios/Chat/Views/Cells/VideoInviteCell.swift +++ b/deltachat-ios/Chat/Views/Cells/VideoInviteCell.swift @@ -40,7 +40,8 @@ public class VideoInviteCell: UITableViewCell, ReusableCell { label.numberOfLines = 0 label.lineBreakMode = .byWordWrapping label.textAlignment = .center - label.font = UIFont.preferredFont(for: .body, weight: .regular) + label.font = UIFont.poppins(.regular, size: 16) +// label.font = UIFont.preferredFont(for: .body, weight: .regular) label.textColor = DcColors.systemMessageFontColor return label }() @@ -51,7 +52,8 @@ public class VideoInviteCell: UITableViewCell, ReusableCell { label.numberOfLines = 0 label.lineBreakMode = .byWordWrapping label.textAlignment = .center - label.font = UIFont.preferredFont(for: .body, weight: .bold) + label.font = UIFont.poppins(.bold, size: 16) +// label.font = UIFont.preferredFont(for: .body, weight: .bold) label.textColor = DcColors.systemMessageFontColor return label }() diff --git a/deltachat-ios/Chat/Views/ChatContactRequestBar.swift b/deltachat-ios/Chat/Views/ChatContactRequestBar.swift index 52d078174..0d33f3cd2 100644 --- a/deltachat-ios/Chat/Views/ChatContactRequestBar.swift +++ b/deltachat-ios/Chat/Views/ChatContactRequestBar.swift @@ -28,7 +28,8 @@ public class ChatContactRequestBar: UIView, InputItem { private lazy var infoLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(for: .body, weight: .regular) + label.font = UIFont.poppins(forTextStyle: .body, weight: PoppinsWeight.regular) +// label.font = UIFont.preferredFont(for: .body, weight: .regular) label.numberOfLines = 0 label.lineBreakMode = .byWordWrapping label.textColor = DcColors.defaultInverseColor diff --git a/deltachat-ios/Chat/Views/ContactCardView.swift b/deltachat-ios/Chat/Views/ContactCardView.swift index b4c74af06..7b4de1040 100644 --- a/deltachat-ios/Chat/Views/ContactCardView.swift +++ b/deltachat-ios/Chat/Views/ContactCardView.swift @@ -33,7 +33,8 @@ public class ContactCardView: UIView { label.translatesAutoresizingMaskIntoConstraints = false label.numberOfLines = 3 label.lineBreakMode = .byCharWrapping - label.font = UIFont.preferredFont(forTextStyle: .headline) + label.font = UIFont.poppins(forTextStyle: .headline) +// label.font = UIFont.preferredFont(forTextStyle: .headline) isAccessibilityElement = false return label }() @@ -42,7 +43,8 @@ public class ContactCardView: UIView { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false label.numberOfLines = 1 - label.font = UIFont.preferredFont(forTextStyle: .caption2) + label.font = UIFont.poppins(forTextStyle: .caption2) +// label.font = UIFont.preferredFont(forTextStyle: .caption2) isAccessibilityElement = false return label }() diff --git a/deltachat-ios/Chat/Views/FileView.swift b/deltachat-ios/Chat/Views/FileView.swift index bca194ccb..0fbe1c940 100644 --- a/deltachat-ios/Chat/Views/FileView.swift +++ b/deltachat-ios/Chat/Views/FileView.swift @@ -37,7 +37,8 @@ public class FileView: UIView { private lazy var fileTypeLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .caption1) + label.font = UIFont.poppins(forTextStyle: .caption1, weight: PoppinsWeight.semibold) +// label.font = UIFont.preferredFont(forTextStyle: .caption1) label.textColor = .label // Use .label for proper dark mode support label.text = "Document File" return label @@ -111,7 +112,8 @@ public class FileView: UIView { lazy var fileTitle: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: PoppinsWeight.medium) +// label.font = UIFont.preferredFont(forTextStyle: .body) label.numberOfLines = 1 label.lineBreakMode = .byTruncatingMiddle label.textColor = .label @@ -122,7 +124,8 @@ public class FileView: UIView { private lazy var fileSubtitle: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .caption2) + label.font = UIFont.poppins(forTextStyle: .caption2, weight: PoppinsWeight.regular) +// label.font = UIFont.preferredFont(forTextStyle: .caption2) label.numberOfLines = 1 label.textColor = .secondaryLabel return label @@ -132,7 +135,8 @@ public class FileView: UIView { private lazy var accessUntilLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .caption2) + label.font = UIFont.poppins(forTextStyle: .caption2, weight: PoppinsWeight.regular) +// label.font = UIFont.preferredFont(forTextStyle: .caption2) label.textColor = .label // Use .label for proper dark mode support label.numberOfLines = 1 return label diff --git a/deltachat-ios/Chat/Views/StatusView.swift b/deltachat-ios/Chat/Views/StatusView.swift index 0792253f7..79023c5cd 100644 --- a/deltachat-ios/Chat/Views/StatusView.swift +++ b/deltachat-ios/Chat/Views/StatusView.swift @@ -15,12 +15,14 @@ public class StatusView: UIView { dateLabel = UILabel() dateLabel.translatesAutoresizingMaskIntoConstraints = false - dateLabel.font = UIFont.preferredFont(for: .caption1, weight: .regular) + dateLabel.font = UIFont.poppins(forTextStyle: .caption1, weight: .regular) +// dateLabel.font = UIFont.preferredFont(for: .caption1, weight: .regular) editedLabel = UILabel() editedLabel.text = String.localized("edited") editedLabel.translatesAutoresizingMaskIntoConstraints = false - editedLabel.font = UIFont.preferredFont(for: .caption1, weight: .regular) + editedLabel.font = UIFont.poppins(forTextStyle: .caption1, weight: .regular) +// editedLabel.font = UIFont.preferredFont(for: .caption1, weight: .regular) envelopeView = UIImageView() envelopeView.translatesAutoresizingMaskIntoConstraints = false diff --git a/deltachat-ios/Controller/AccountSetup/Instand Onboarding/InstantOnboardingView.swift b/deltachat-ios/Controller/AccountSetup/Instand Onboarding/InstantOnboardingView.swift index 2968313fc..5833a3e93 100644 --- a/deltachat-ios/Controller/AccountSetup/Instand Onboarding/InstantOnboardingView.swift +++ b/deltachat-ios/Controller/AccountSetup/Instand Onboarding/InstantOnboardingView.swift @@ -45,11 +45,12 @@ class InstantOnboardingView: UIView { nameTextField.translatesAutoresizingMaskIntoConstraints = false nameTextField.placeholder = String.localized("pref_your_name") nameTextField.borderStyle = .roundedRect + nameTextField.font = UIFont.poppins(forTextStyle: .body, weight: .regular) hintLabel = UILabel() hintLabel.translatesAutoresizingMaskIntoConstraints = false hintLabel.numberOfLines = 0 - hintLabel.font = UIFont.preferredFont(forTextStyle: .subheadline) + hintLabel.font = UIFont.poppins(forTextStyle: .subheadline, weight: .regular) hintLabel.text = String.localized("set_name_and_avatar_explain") hintLabelWrapper = UIView() @@ -58,7 +59,7 @@ class InstantOnboardingView: UIView { agreeButton = UIButton() agreeButton.setTitle(String.localized("instant_onboarding_create"), for: .normal) - agreeButton.titleLabel?.font = UIFont.preferredFont(forTextStyle: .body) + agreeButton.titleLabel?.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) agreeButton.setTitleColor(.white, for: .normal) agreeButton.translatesAutoresizingMaskIntoConstraints = false agreeButton.layer.cornerRadius = 5 @@ -66,13 +67,14 @@ class InstantOnboardingView: UIView { privacyButton = UIButton(type: .system) privacyButton.translatesAutoresizingMaskIntoConstraints = false + privacyButton.titleLabel?.font = UIFont.poppins(forTextStyle: .body, weight: .regular) privacyButtonWrapper = UIView() privacyButtonWrapper.translatesAutoresizingMaskIntoConstraints = false privacyButtonWrapper.addSubview(privacyButton) otherOptionsButton = UIButton(type: .system) otherOptionsButton.setTitle(String.localized("instant_onboarding_show_more_instances"), for: .normal) - otherOptionsButton.titleLabel?.font = UIFont.preferredFont(forTextStyle: .body) + otherOptionsButton.titleLabel?.font = UIFont.poppins(forTextStyle: .body, weight: .medium) otherOptionsButton.translatesAutoresizingMaskIntoConstraints = false contentStackView = UIStackView(arrangedSubviews: [imageButton, nameTextField, hintLabelWrapper, privacyButtonWrapper, agreeButton, otherOptionsButton]) diff --git a/deltachat-ios/Controller/AccountSetup/WelcomeViewController.swift b/deltachat-ios/Controller/AccountSetup/WelcomeViewController.swift index 661855068..eb21d7e3a 100644 --- a/deltachat-ios/Controller/AccountSetup/WelcomeViewController.swift +++ b/deltachat-ios/Controller/AccountSetup/WelcomeViewController.swift @@ -374,7 +374,7 @@ class WelcomeContentView: UIView { label.text = "Welcome to" label.textAlignment = .center label.numberOfLines = 1 - label.font = AppFont.medium(size: 47) // Android: 47sp + label.font = UIFont.poppins(.medium, size: 47) // label.font = AppFont.medium(size: 47) // Android: 47sp label.textColor = UIColor(hexString: "020202") // Black label.translatesAutoresizingMaskIntoConstraints = false return label @@ -403,7 +403,8 @@ class WelcomeContentView: UIView { label.text = "Privitty" label.textAlignment = .center label.numberOfLines = 1 - label.font = AppFont.medium(size: 45) // Android: 45sp + label.font = UIFont.poppins(.medium, size: 45) + // label.font = AppFont.medium(size: 45) // Android: 45sp label.textColor = UIColor(hexString: "6750A4") // Purple label.translatesAutoresizingMaskIntoConstraints = false return label @@ -427,7 +428,7 @@ class WelcomeContentView: UIView { label.attributedText = NSAttributedString( string: text, attributes: [ - .font: AppFont.regular(size: 18), // Slightly smaller for better spacing + .font: UIFont.poppins(.regular, size: 18), .foregroundColor: UIColor(hexString: "4F4F4F"), // secondary_message color .paragraphStyle: paragraphStyle ] @@ -440,7 +441,7 @@ class WelcomeContentView: UIView { let button = UIButton(type: .system) let title = String.localized("onboarding_create_instant_account") button.setTitle(title, for: .normal) - button.titleLabel?.font = AppFont.medium(size: 16) + button.titleLabel?.font = UIFont.poppins(.medium, size: 16) button.setTitleColor(UIColor(hexString: "F6F6F6"), for: .normal) // White button.backgroundColor = UIColor(hexString: "6750A4") // Figma: #6750A4 button.layer.cornerRadius = 30 // Height 60 / 2 = fully rounded @@ -454,7 +455,7 @@ class WelcomeContentView: UIView { let button = UIButton(type: .system) let title = String.localized("onboarding_alternative_logins") button.setTitle(title, for: .normal) - button.titleLabel?.font = AppFont.medium(size: 16) + button.titleLabel?.font = UIFont.poppins(.medium, size: 16) button.setTitleColor(UIColor(hexString: "020202"), for: .normal) // Black button.backgroundColor = UIColor(hexString: "F8F5FF") // Match bottom sheet button.layer.cornerRadius = 30 diff --git a/deltachat-ios/Controller/AllMediaViewController.swift b/deltachat-ios/Controller/AllMediaViewController.swift index a36053b3e..d53f9252a 100644 --- a/deltachat-ios/Controller/AllMediaViewController.swift +++ b/deltachat-ios/Controller/AllMediaViewController.swift @@ -214,13 +214,13 @@ final class AllMediaViewController: UIPageViewController { let normalTextAttributes: [NSAttributedString.Key: Any] = [ .foregroundColor: DcColors.defaultInverseColor, - .font: AppFont.medium(size: 14) + .font: UIFont.poppins(PoppinsWeight.medium, size: 14) ] control.setTitleTextAttributes(normalTextAttributes, for: .normal) let selectedTextAttributes: [NSAttributedString.Key: Any] = [ .foregroundColor: DcColors.defaultBackgroundColor, - .font: AppFont.medium(size: 14) + .font: UIFont.poppins(PoppinsWeight.medium, size: 14) ] control.setTitleTextAttributes(selectedTextAttributes, for: .selected) diff --git a/deltachat-ios/Controller/BackupTransferViewController.swift b/deltachat-ios/Controller/BackupTransferViewController.swift index 02c513cbe..b8d89eb2f 100644 --- a/deltachat-ios/Controller/BackupTransferViewController.swift +++ b/deltachat-ios/Controller/BackupTransferViewController.swift @@ -46,7 +46,8 @@ class BackupTransferViewController: UIViewController { statusLine.textAlignment = .center statusLine.numberOfLines = 0 statusLine.lineBreakMode = .byWordWrapping - statusLine.font = .preferredFont(forTextStyle: .body) + statusLine.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + statusLine.adjustsFontForContentSizeCategory = true qrContentView = UIImageView() qrContentView.contentMode = .scaleAspectFit @@ -68,7 +69,6 @@ class BackupTransferViewController: UIViewController { view.addSubview(contentScrollView) view.addSubview(activityIndicator) - view.backgroundColor = DcColors.defaultBackgroundColor setupSubviews() diff --git a/deltachat-ios/Controller/ChatListViewController.swift b/deltachat-ios/Controller/ChatListViewController.swift index d60278697..865056bbe 100644 --- a/deltachat-ios/Controller/ChatListViewController.swift +++ b/deltachat-ios/Controller/ChatListViewController.swift @@ -29,6 +29,22 @@ class ChatListViewController: UITableViewController { let searchController = UISearchController(searchResultsController: nil) searchController.obscuresBackgroundDuringPresentation = false searchController.searchBar.placeholder = String.localized("search") + + if #available(iOS 13.0, *) { + let textField = searchController.searchBar.searchTextField + textField.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + + if let placeholder = textField.placeholder { + textField.attributedPlaceholder = NSAttributedString( + string: placeholder, + attributes: [ + .font: UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular), + .foregroundColor: UIColor.secondaryLabel + ] + ) + } + } + return searchController }() @@ -313,6 +329,7 @@ class ChatListViewController: UITableViewController { tableView.register(ContactCell.self, forCellReuseIdentifier: ContactCell.reuseIdentifier) tableView.rowHeight = ContactCell.cellHeight tableView.allowsMultipleSelectionDuringEditing = true + tableView.backgroundColor = DcColors.chatBackgroundColor } private var isInitial = true @@ -406,6 +423,7 @@ class ChatListViewController: UITableViewController { } // Update background color for theme changes self.view.backgroundColor = DcColors.chatBackgroundColor + self.tableView.backgroundColor = DcColors.chatBackgroundColor } func quitSearch(animated: Bool) { diff --git a/deltachat-ios/Controller/ConnectivityViewController.swift b/deltachat-ios/Controller/ConnectivityViewController.swift index 9ac96ebc2..f75a3ecbb 100644 --- a/deltachat-ios/Controller/ConnectivityViewController.swift +++ b/deltachat-ios/Controller/ConnectivityViewController.swift @@ -116,7 +116,8 @@ final class ConnectivityViewController: WebViewViewController { appearance.configureWithOpaqueBackground() appearance.backgroundColor = DcColors.chatBackgroundColor appearance.titleTextAttributes = [ - .foregroundColor: DcColors.defaultInverseColor + .foregroundColor: DcColors.defaultInverseColor, + .font: UIFont.poppins(PoppinsWeight.semibold, size: 17) ] navigationController?.navigationBar.standardAppearance = appearance @@ -155,7 +156,7 @@ final class ConnectivityViewController: WebViewViewController { """ body { font-size: 13pt; - font-family: -apple-system, BlinkMacSystemFont, sans-serif; + font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif; padding: 0 .5rem .5rem .5rem; -webkit-text-size-adjust: none; background-color: transparent; diff --git a/deltachat-ios/Controller/ContentDetailsViewController.swift b/deltachat-ios/Controller/ContentDetailsViewController.swift index 49c3414b8..d39d98571 100644 --- a/deltachat-ios/Controller/ContentDetailsViewController.swift +++ b/deltachat-ios/Controller/ContentDetailsViewController.swift @@ -45,7 +45,7 @@ class ContentDetailsViewController: UIViewController { private lazy var fileNameLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = .preferredFont(forTextStyle: .headline) + label.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) label.textColor = .label label.numberOfLines = 2 label.lineBreakMode = .byTruncatingMiddle @@ -55,7 +55,8 @@ class ContentDetailsViewController: UIViewController { private lazy var fileSizeLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = .preferredFont(forTextStyle: .subheadline) + label.font = UIFont.poppins(forTextStyle: .subheadline, weight: .regular) +// label.font = .preferredFont(forTextStyle: .subheadline) label.textColor = .secondaryLabel return label }() @@ -72,7 +73,8 @@ class ContentDetailsViewController: UIViewController { private lazy var accessStatusTitleLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = .preferredFont(forTextStyle: .headline) + label.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) +// label.font = .preferredFont(forTextStyle: .headline) label.textColor = .label label.text = String.localized("privitty_access_status") return label @@ -81,7 +83,7 @@ class ContentDetailsViewController: UIViewController { private lazy var accessStatusValueLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = .preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.textColor = .secondaryLabel label.numberOfLines = 0 return label @@ -106,7 +108,8 @@ class ContentDetailsViewController: UIViewController { private lazy var permissionsTitleLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = .preferredFont(forTextStyle: .headline) + label.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) +// label.font = .preferredFont(forTextStyle: .headline) label.textColor = .label label.text = String.localized("privitty_permissions") return label @@ -147,7 +150,8 @@ class ContentDetailsViewController: UIViewController { private lazy var expiryValueLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = .preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) +// label.font = .preferredFont(forTextStyle: .body) label.textColor = .secondaryLabel label.numberOfLines = 0 return label @@ -428,7 +432,8 @@ private class PermissionRowView: UIView { private lazy var titleLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = .preferredFont(forTextStyle: .body) +// label.font = .preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.textColor = .label return label }() diff --git a/deltachat-ios/Controller/EditContactController.swift b/deltachat-ios/Controller/EditContactController.swift index 59df42643..1379e745f 100644 --- a/deltachat-ios/Controller/EditContactController.swift +++ b/deltachat-ios/Controller/EditContactController.swift @@ -32,7 +32,6 @@ class EditContactController: UITableViewController { tableView.backgroundColor = DcColors.chatBackgroundColor let appearance = UINavigationBarAppearance() appearance.configureWithOpaqueBackground() - appearance.backgroundColor = DcColors.chatBackgroundColor appearance.titleTextAttributes = [ .foregroundColor: UIColor.label ] diff --git a/deltachat-ios/Controller/FileAccessControlViewController.swift b/deltachat-ios/Controller/FileAccessControlViewController.swift index 94c47dfeb..148fa09f1 100644 --- a/deltachat-ios/Controller/FileAccessControlViewController.swift +++ b/deltachat-ios/Controller/FileAccessControlViewController.swift @@ -35,7 +35,10 @@ public class FileAccessControlViewController: UIViewController { private lazy var titleLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .headline) +// label.font = UIFont.preferredFont(forTextStyle: .headline) + label.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) + + label.text = "File Access Control" return label }() @@ -43,7 +46,8 @@ public class FileAccessControlViewController: UIViewController { private lazy var subtitleLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .subheadline) +// label.font = UIFont.preferredFont(forTextStyle: .subheadline) + label.font = UIFont.poppins(forTextStyle: .subheadline, weight: .regular) label.textColor = .secondaryLabel label.text = fileName return label @@ -63,7 +67,8 @@ public class FileAccessControlViewController: UIViewController { private lazy var emptyStateLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .body) +// label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.textColor = .secondaryLabel label.text = "No access requests" label.textAlignment = .center @@ -410,14 +415,15 @@ class FileAccessRequesteeCell: UITableViewCell { private lazy var nameLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .body) +// label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) return label }() private lazy var emailLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .caption1) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.textColor = .secondaryLabel return label }() @@ -425,7 +431,7 @@ class FileAccessRequesteeCell: UITableViewCell { private lazy var statusLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .caption1) + label.font = UIFont.poppins(forTextStyle: .caption1, weight: .medium) label.textColor = .systemGray return label }() diff --git a/deltachat-ios/Controller/FileAccessRequestBottomSheet.swift b/deltachat-ios/Controller/FileAccessRequestBottomSheet.swift index 2eb2830b6..343c87e1a 100644 --- a/deltachat-ios/Controller/FileAccessRequestBottomSheet.swift +++ b/deltachat-ios/Controller/FileAccessRequestBottomSheet.swift @@ -41,7 +41,7 @@ public class FileAccessRequestBottomSheet: UIViewController { private lazy var titleLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .headline) + label.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) label.text = "File Access Request" return label }() @@ -49,7 +49,7 @@ public class FileAccessRequestBottomSheet: UIViewController { private lazy var userNameLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.textColor = .secondaryLabel label.text = requestee.name return label @@ -58,7 +58,7 @@ public class FileAccessRequestBottomSheet: UIViewController { private lazy var timeSelectorLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .subheadline) + label.font = UIFont.poppins(forTextStyle: .subheadline, weight: .medium) label.text = "Access Until (Date & Time)" return label }() @@ -88,7 +88,7 @@ public class FileAccessRequestBottomSheet: UIViewController { private lazy var downloadLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.text = "Allow Download" return label }() @@ -103,7 +103,7 @@ public class FileAccessRequestBottomSheet: UIViewController { private lazy var forwardLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.text = "Allow Forward" return label }() @@ -116,7 +116,7 @@ public class FileAccessRequestBottomSheet: UIViewController { let button = UIButton(type: .system) button.translatesAutoresizingMaskIntoConstraints = false button.setTitle("Accept", for: .normal) - button.titleLabel?.font = UIFont.preferredFont(forTextStyle: .headline) + button.titleLabel?.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) // #6750A4 = RGB(103, 80, 164) button.backgroundColor = UIColor(red: 103/255.0, green: 80/255.0, blue: 164/255.0, alpha: 1.0) button.setTitleColor(.white, for: .normal) @@ -129,7 +129,7 @@ public class FileAccessRequestBottomSheet: UIViewController { let button = UIButton(type: .system) button.translatesAutoresizingMaskIntoConstraints = false button.setTitle("Deny", for: .normal) - button.titleLabel?.font = UIFont.preferredFont(forTextStyle: .headline) + button.titleLabel?.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) button.backgroundColor = .systemGray4 // Default iOS color for secondary actions button.setTitleColor(.label, for: .normal) button.layer.cornerRadius = 8 diff --git a/deltachat-ios/Controller/FileAttachmentOptionsBottomSheet.swift b/deltachat-ios/Controller/FileAttachmentOptionsBottomSheet.swift index 7fea2483d..d91f0113d 100644 --- a/deltachat-ios/Controller/FileAttachmentOptionsBottomSheet.swift +++ b/deltachat-ios/Controller/FileAttachmentOptionsBottomSheet.swift @@ -36,7 +36,7 @@ public class FileAttachmentOptionsBottomSheet: UIViewController { private lazy var titleLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .headline) + label.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) label.text = "Attach File" return label }() @@ -44,7 +44,7 @@ public class FileAttachmentOptionsBottomSheet: UIViewController { private lazy var messageLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .subheadline) + label.font = UIFont.poppins(forTextStyle: .subheadline, weight: .regular) label.textColor = .secondaryLabel label.text = "Set access time and permissions" label.numberOfLines = 0 @@ -54,7 +54,7 @@ public class FileAttachmentOptionsBottomSheet: UIViewController { private lazy var expiryLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .subheadline) + label.font = UIFont.poppins(forTextStyle: .subheadline, weight: .medium) label.text = "Expires On (Date & Time)" return label }() @@ -84,7 +84,7 @@ public class FileAttachmentOptionsBottomSheet: UIViewController { private lazy var downloadLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.text = "Allow Download" return label }() @@ -99,7 +99,7 @@ public class FileAttachmentOptionsBottomSheet: UIViewController { private lazy var forwardLabel: UILabel = { let label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.text = "Allow Forward" return label }() @@ -108,7 +108,7 @@ public class FileAttachmentOptionsBottomSheet: UIViewController { let button = UIButton(type: .system) button.translatesAutoresizingMaskIntoConstraints = false button.setTitle("OK", for: .normal) - button.titleLabel?.font = UIFont.preferredFont(forTextStyle: .headline) + button.titleLabel?.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) // #6750A4 = RGB(103, 80, 164) button.backgroundColor = UIColor(red: 103/255.0, green: 80/255.0, blue: 164/255.0, alpha: 1.0) button.setTitleColor(.white, for: .normal) @@ -121,7 +121,7 @@ public class FileAttachmentOptionsBottomSheet: UIViewController { let button = UIButton(type: .system) button.translatesAutoresizingMaskIntoConstraints = false button.setTitle("Cancel", for: .normal) - button.titleLabel?.font = UIFont.preferredFont(forTextStyle: .headline) + button.titleLabel?.font = UIFont.poppins(forTextStyle: .headline, weight: .semibold) button.backgroundColor = .systemGray4 // Default iOS color for secondary actions button.setTitleColor(.label, for: .normal) button.layer.cornerRadius = 8 diff --git a/deltachat-ios/Controller/GroupMembersViewController.swift b/deltachat-ios/Controller/GroupMembersViewController.swift index d53f0f8e2..9f9d467de 100644 --- a/deltachat-ios/Controller/GroupMembersViewController.swift +++ b/deltachat-ios/Controller/GroupMembersViewController.swift @@ -61,6 +61,22 @@ class GroupMembersViewController: UITableViewController { searchController.obscuresBackgroundDuringPresentation = false searchController.searchBar.placeholder = String.localized("search") searchController.hidesNavigationBarDuringPresentation = false + + if #available(iOS 13.0, *) { + let textField = searchController.searchBar.searchTextField + textField.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + + if let placeholder = textField.placeholder { + textField.attributedPlaceholder = NSAttributedString( + string: placeholder, + attributes: [ + .font: UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular), + .foregroundColor: UIColor.secondaryLabel + ] + ) + } + } + return searchController }() @@ -90,6 +106,7 @@ class GroupMembersViewController: UITableViewController { navigationItem.hidesSearchBarWhenScrolling = false configureTableView() definesPresentationContext = true + view.backgroundColor = DcColors.chatBackgroundColor } // MARK: - setup + configuration diff --git a/deltachat-ios/Controller/HelpViewController.swift b/deltachat-ios/Controller/HelpViewController.swift index 1bfb28d59..77642ada6 100644 --- a/deltachat-ios/Controller/HelpViewController.swift +++ b/deltachat-ios/Controller/HelpViewController.swift @@ -131,6 +131,15 @@ final class HelpViewController: WebViewViewController { webView.backgroundColor = .clear webView.scrollView.backgroundColor = .clear + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = DcColors.defaultBackgroundColor + appearance.titleTextAttributes = [ + .foregroundColor: DcColors.defaultInverseColor, + .font: UIFont.poppins(PoppinsWeight.semibold, size: 17) + ] + navigationController?.navigationBar.standardAppearance = appearance + navigationController?.navigationBar.scrollEdgeAppearance = appearance navigationItem.rightBarButtonItem = moreButton } diff --git a/deltachat-ios/Controller/NewChatViewController.swift b/deltachat-ios/Controller/NewChatViewController.swift index b654a7ada..92551b03d 100644 --- a/deltachat-ios/Controller/NewChatViewController.swift +++ b/deltachat-ios/Controller/NewChatViewController.swift @@ -25,6 +25,22 @@ class NewChatViewController: UITableViewController { searchController.searchResultsUpdater = self searchController.obscuresBackgroundDuringPresentation = false searchController.searchBar.placeholder = String.localized("search") + + if #available(iOS 13.0, *) { + let textField = searchController.searchBar.searchTextField + textField.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + + if let placeholder = textField.placeholder { + textField.attributedPlaceholder = NSAttributedString( + string: placeholder, + attributes: [ + .font: UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular), + .foregroundColor: UIColor.secondaryLabel + ] + ) + } + } + return searchController }() @@ -91,6 +107,8 @@ class NewChatViewController: UITableViewController { super.viewDidLoad() title = String.localized("menu_new_chat") + view.backgroundColor = DcColors.chatBackgroundColor + tableView.backgroundColor = DcColors.chatBackgroundColor deviceContactHandler.importDeviceContacts() navigationItem.searchController = searchController diff --git a/deltachat-ios/Controller/QrCodeReaderController.swift b/deltachat-ios/Controller/QrCodeReaderController.swift index 3675707c2..eab865d8e 100644 --- a/deltachat-ios/Controller/QrCodeReaderController.swift +++ b/deltachat-ios/Controller/QrCodeReaderController.swift @@ -33,7 +33,8 @@ class QrCodeReaderController: UIViewController { label.textAlignment = .center label.textColor = .white label.adjustsFontForContentSizeCategory = true - label.font = .preferredFont(forTextStyle: .title2) + label.font = UIFont.poppins(forTextStyle: .title2, weight: .regular) +// label.font = .preferredFont(forTextStyle: .title2) return label }() diff --git a/deltachat-ios/Controller/QrPageController.swift b/deltachat-ios/Controller/QrPageController.swift index db28a4e23..9b9b22720 100644 --- a/deltachat-ios/Controller/QrPageController.swift +++ b/deltachat-ios/Controller/QrPageController.swift @@ -21,6 +21,12 @@ class QrPageController: UIPageViewController { control.tintColor = DcColors.primary control.addTarget(self, action: #selector(qrSegmentControlChanged), for: .valueChanged) control.selectedSegmentIndex = 0 + + let segmentFont = UIFont.poppins(forTextStyle: .subheadline, weight: .medium) + let normalAttributes: [NSAttributedString.Key: Any] = [.font: segmentFont] + control.setTitleTextAttributes(normalAttributes, for: .normal) + control.setTitleTextAttributes(normalAttributes, for: .selected) + return control }() @@ -43,6 +49,7 @@ class QrPageController: UIPageViewController { // MARK: - lifecycle override func viewDidLoad() { super.viewDidLoad() + view.backgroundColor = DcColors.chatBackgroundColor dataSource = self delegate = self navigationItem.titleView = qrSegmentControl @@ -55,7 +62,11 @@ class QrPageController: UIPageViewController { completion: nil ) - navigationController?.navigationBar.scrollEdgeAppearance = navigationController?.navigationBar.standardAppearance + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = DcColors.chatBackgroundColor + navigationController?.navigationBar.standardAppearance = appearance + navigationController?.navigationBar.scrollEdgeAppearance = appearance } override func viewWillAppear(_ animated: Bool) { diff --git a/deltachat-ios/Controller/Settings/AdvancedViewController.swift b/deltachat-ios/Controller/Settings/AdvancedViewController.swift index baa130475..10fa71070 100644 --- a/deltachat-ios/Controller/Settings/AdvancedViewController.swift +++ b/deltachat-ios/Controller/Settings/AdvancedViewController.swift @@ -31,8 +31,10 @@ internal final class AdvancedViewController: UITableViewController { let cell = UITableViewCell(style: .value1, reuseIdentifier: nil) cell.tag = CellTags.showEmails.rawValue cell.textLabel?.text = String.localized("pref_show_emails") + cell.textLabel?.font = UIFont.poppins(PoppinsWeight.regular, size: 16) cell.accessoryType = .disclosureIndicator cell.detailTextLabel?.text = EmailOptionsViewController.getValString(val: dcContext.showEmails) + cell.detailTextLabel?.font = UIFont.poppins(PoppinsWeight.regular, size: 14) return cell }() @@ -40,12 +42,14 @@ internal final class AdvancedViewController: UITableViewController { let cell = UITableViewCell(style: .default, reuseIdentifier: nil) cell.tag = CellTags.sendAutocryptMessage.rawValue cell.textLabel?.text = String.localized("autocrypt_send_asm_title") + cell.textLabel?.font = UIFont.poppins(PoppinsWeight.regular, size: 16) return cell }() private lazy var accountSettingsCell: UITableViewCell = { let cell = UITableViewCell(style: .default, reuseIdentifier: nil) cell.textLabel?.text = String.localized("pref_password_and_account_settings") + cell.textLabel?.font = UIFont.poppins(PoppinsWeight.regular, size: 16) cell.accessoryType = .disclosureIndicator cell.tag = CellTags.accountSettings.rawValue return cell @@ -54,8 +58,10 @@ internal final class AdvancedViewController: UITableViewController { private lazy var proxySettingsCell: UITableViewCell = { let cell = UITableViewCell(style: .value1, reuseIdentifier: nil) cell.textLabel?.text = String.localized("proxy_settings") + cell.textLabel?.font = UIFont.poppins(PoppinsWeight.semibold, size: 16) cell.accessoryType = .disclosureIndicator cell.tag = CellTags.proxySettings.rawValue + cell.detailTextLabel?.font = UIFont.poppins(PoppinsWeight.regular, size: 14) return cell }() @@ -143,6 +149,7 @@ internal final class AdvancedViewController: UITableViewController { let cell = UITableViewCell(style: .value1, reuseIdentifier: nil) cell.tag = CellTags.videoChat.rawValue cell.textLabel?.text = String.localized("videochat_instance") + cell.textLabel?.font = UIFont.poppins(PoppinsWeight.regular, size: 16) cell.accessoryType = .disclosureIndicator return cell }() @@ -195,6 +202,7 @@ internal final class AdvancedViewController: UITableViewController { let cell = UITableViewCell(style: .value1, reuseIdentifier: nil) cell.tag = CellTags.viewLog.rawValue cell.textLabel?.text = String.localized("pref_view_log") + cell.textLabel?.font = UIFont.poppins(PoppinsWeight.semibold, size: 16) cell.accessoryType = .disclosureIndicator return cell }() diff --git a/deltachat-ios/Controller/Settings/AutodelOptionsViewController.swift b/deltachat-ios/Controller/Settings/AutodelOptionsViewController.swift index 3d8d79c51..932a6fd60 100644 --- a/deltachat-ios/Controller/Settings/AutodelOptionsViewController.swift +++ b/deltachat-ios/Controller/Settings/AutodelOptionsViewController.swift @@ -82,6 +82,7 @@ class AutodelOptionsViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() + view.backgroundColor = DcColors.chatBackgroundColor navigationItem.leftBarButtonItem = cancelButton navigationItem.rightBarButtonItem = okButton } @@ -179,6 +180,9 @@ class AutodelOptionsViewController: UITableViewController { cell.backgroundColor = DcColors.settingScreenBackgroundColor cell.contentView.backgroundColor = DcColors.settingScreenBackgroundColor } + + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true } // MARK: - actions diff --git a/deltachat-ios/Controller/Settings/AutodelOverviewViewController.swift b/deltachat-ios/Controller/Settings/AutodelOverviewViewController.swift index e46eaddf7..83fb689ad 100644 --- a/deltachat-ios/Controller/Settings/AutodelOverviewViewController.swift +++ b/deltachat-ios/Controller/Settings/AutodelOverviewViewController.swift @@ -54,6 +54,11 @@ class AutodelOverviewViewController: UITableViewController { fatalError("init(coder:) has not been implemented") } + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = DcColors.chatBackgroundColor + } + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) tableView.reloadData() // needed to update footer @@ -113,6 +118,11 @@ class AutodelOverviewViewController: UITableViewController { let bgColor = DcColors.settingScreenBackgroundColor cell.backgroundColor = bgColor cell.contentView.backgroundColor = bgColor + + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true + cell.detailTextLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote, weight: PoppinsWeight.regular) + cell.detailTextLabel?.adjustsFontForContentSizeCategory = true } } diff --git a/deltachat-ios/Controller/Settings/BackgroundOptionsViewController.swift b/deltachat-ios/Controller/Settings/BackgroundOptionsViewController.swift index 5d54b83b7..939bddc8a 100644 --- a/deltachat-ios/Controller/Settings/BackgroundOptionsViewController.swift +++ b/deltachat-ios/Controller/Settings/BackgroundOptionsViewController.swift @@ -17,7 +17,7 @@ class BackgroundOptionsViewController: UIViewController, MediaPickerDelegate { btn.titleLabel?.lineBreakMode = .byWordWrapping btn.titleLabel?.textAlignment = .center btn.contentHorizontalAlignment = .center - btn.titleLabel?.font = UIFont.preferredFont(for: .body, weight: .regular) + btn.titleLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) btn.titleLabel?.adjustsFontForContentSizeCategory = true btn.addTarget(self, action: #selector(onSelectBackgroundImage), for: .touchUpInside) return btn @@ -35,7 +35,7 @@ class BackgroundOptionsViewController: UIViewController, MediaPickerDelegate { btn.titleLabel?.textAlignment = .center btn.contentHorizontalAlignment = .center btn.addTarget(self, action: #selector(onDefaultSelected), for: .touchUpInside) - btn.titleLabel?.font = UIFont.preferredFont(for: .body, weight: .regular) + btn.titleLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) btn.titleLabel?.adjustsFontForContentSizeCategory = true return btn }() diff --git a/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift b/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift index 6482fda5d..282c31a15 100644 --- a/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift +++ b/deltachat-ios/Controller/Settings/ChatsAndMediaViewController.swift @@ -30,6 +30,8 @@ internal final class ChatsAndMediaViewController: UITableViewController { cell.tag = CellTags.blockedContacts.rawValue cell.textLabel?.text = String.localized("pref_blocked_contacts") cell.textLabel?.textColor = DcColors.redIconColor + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true cell.setCustomDisclosureIndicator(imageName: "next_screen_indicator_icon", tintColor: DcColors.defaultInverseColor) return cell }() @@ -48,8 +50,12 @@ internal final class ChatsAndMediaViewController: UITableViewController { let cell = UITableViewCell(style: .value1, reuseIdentifier: nil) cell.tag = CellTags.autodel.rawValue cell.textLabel?.text = String.localized("delete_old_messages") + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true cell.setCustomDisclosureIndicator(imageName: "next_screen_indicator_icon", tintColor: DcColors.defaultInverseColor) cell.detailTextLabel?.text = autodelSummary() + cell.detailTextLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote, weight: PoppinsWeight.regular) + cell.detailTextLabel?.adjustsFontForContentSizeCategory = true return cell }() @@ -57,8 +63,12 @@ internal final class ChatsAndMediaViewController: UITableViewController { let cell = UITableViewCell(style: .value1, reuseIdentifier: nil) cell.tag = CellTags.mediaQuality.rawValue cell.textLabel?.text = String.localized("pref_outgoing_media_quality") + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true cell.setCustomDisclosureIndicator(imageName: "next_screen_indicator_icon", tintColor: DcColors.defaultInverseColor) cell.detailTextLabel?.text = MediaQualityViewController.getValString(val: dcContext.getConfigInt("media_quality")) + cell.detailTextLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote, weight: PoppinsWeight.regular) + cell.detailTextLabel?.adjustsFontForContentSizeCategory = true return cell }() @@ -66,8 +76,12 @@ internal final class ChatsAndMediaViewController: UITableViewController { let cell = UITableViewCell(style: .value1, reuseIdentifier: nil) cell.tag = CellTags.downloadOnDemand.rawValue cell.textLabel?.text = String.localized("auto_download_messages") + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true cell.setCustomDisclosureIndicator(imageName: "next_screen_indicator_icon", tintColor: DcColors.defaultInverseColor) cell.detailTextLabel?.text = DownloadOnDemandViewController.getValString(val: dcContext.getConfigInt("download_limit")) + cell.detailTextLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote, weight: PoppinsWeight.regular) + cell.detailTextLabel?.adjustsFontForContentSizeCategory = true return cell }() @@ -95,6 +109,8 @@ internal final class ChatsAndMediaViewController: UITableViewController { let cell = UITableViewCell(style: .default, reuseIdentifier: nil) cell.tag = CellTags.receiptConfirmation.rawValue cell.textLabel?.text = String.localized("pref_read_receipts") + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true cell.accessoryView = receiptConfirmationSwitch cell.selectionStyle = .none return cell diff --git a/deltachat-ios/Controller/Settings/DownloadOnDemandViewController.swift b/deltachat-ios/Controller/Settings/DownloadOnDemandViewController.swift index 641f9f93d..30b4fb619 100644 --- a/deltachat-ios/Controller/Settings/DownloadOnDemandViewController.swift +++ b/deltachat-ios/Controller/Settings/DownloadOnDemandViewController.swift @@ -26,6 +26,11 @@ class DownloadOnDemandViewController: UITableViewController { fatalError("init(coder:) has not been implemented") } + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = DcColors.chatBackgroundColor + } + static func getValString(val: Int) -> String { switch val { case 0: @@ -91,5 +96,8 @@ class DownloadOnDemandViewController: UITableViewController { cell.backgroundColor = DcColors.iconBackgroundColor cell.contentView.backgroundColor = DcColors.iconBackgroundColor } + + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true } } diff --git a/deltachat-ios/Controller/Settings/EmailOptionsViewController.swift b/deltachat-ios/Controller/Settings/EmailOptionsViewController.swift index 8dc9cbda3..c4e659c6a 100644 --- a/deltachat-ios/Controller/Settings/EmailOptionsViewController.swift +++ b/deltachat-ios/Controller/Settings/EmailOptionsViewController.swift @@ -63,4 +63,13 @@ class EmailOptionsViewController: UITableViewController { } return cell } + + override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { + let bgColor = DcColors.settingScreenBackgroundColor + cell.backgroundColor = bgColor + cell.contentView.backgroundColor = bgColor + + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true + } } diff --git a/deltachat-ios/Controller/Settings/MediaQualityViewController.swift b/deltachat-ios/Controller/Settings/MediaQualityViewController.swift index b3c2407e6..6420481ff 100644 --- a/deltachat-ios/Controller/Settings/MediaQualityViewController.swift +++ b/deltachat-ios/Controller/Settings/MediaQualityViewController.swift @@ -26,6 +26,11 @@ class MediaQualityViewController: UITableViewController { fatalError("init(coder:) has not been implemented") } + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = DcColors.chatBackgroundColor + } + static func getValString(val: Int) -> String { switch Int32(val) { case DC_MEDIA_QUALITY_BALANCED: @@ -84,5 +89,8 @@ class MediaQualityViewController: UITableViewController { cell.backgroundColor = DcColors.iconBackgroundColor cell.contentView.backgroundColor = DcColors.iconBackgroundColor } + + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true } } diff --git a/deltachat-ios/Controller/Settings/Proxy/ProxyTableViewCell.swift b/deltachat-ios/Controller/Settings/Proxy/ProxyTableViewCell.swift index 7c50a7372..e7d04cbcf 100644 --- a/deltachat-ios/Controller/Settings/Proxy/ProxyTableViewCell.swift +++ b/deltachat-ios/Controller/Settings/Proxy/ProxyTableViewCell.swift @@ -18,11 +18,13 @@ class ProxyTableViewCell: UITableViewCell { let detailsColor = UIColor.secondaryLabel protocolLabel.textColor = detailsColor - protocolLabel.font = UIFont.preferredFont(forTextStyle: .footnote) + protocolLabel.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote, weight: PoppinsWeight.regular) + protocolLabel.adjustsFontForContentSizeCategory = true connectionLabel = UILabel() connectionLabel.textColor = detailsColor - connectionLabel.font = UIFont.preferredFont(forTextStyle: .footnote) + connectionLabel.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote, weight: PoppinsWeight.regular) + connectionLabel.adjustsFontForContentSizeCategory = true subtitleStackView = UIStackView( arrangedSubviews: [ @@ -41,6 +43,8 @@ class ProxyTableViewCell: UITableViewCell { super.init(style: style, reuseIdentifier: reuseIdentifier) + hostLabel.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + hostLabel.adjustsFontForContentSizeCategory = true contentView.addSubview(contentStackView) setupConstraints() diff --git a/deltachat-ios/Controller/Settings/Proxy/ShareProxyViewController.swift b/deltachat-ios/Controller/Settings/Proxy/ShareProxyViewController.swift index d1cf9e11e..805e1eb76 100644 --- a/deltachat-ios/Controller/Settings/Proxy/ShareProxyViewController.swift +++ b/deltachat-ios/Controller/Settings/Proxy/ShareProxyViewController.swift @@ -33,7 +33,8 @@ class ShareProxyViewController: UIViewController { explanationLabel = UILabel() explanationLabel.translatesAutoresizingMaskIntoConstraints = false - explanationLabel.font = UIFont.preferredFont(forTextStyle: .caption1) + explanationLabel.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.caption1, weight: PoppinsWeight.regular) + explanationLabel.adjustsFontForContentSizeCategory = true explanationLabel.text = String.localized("proxy_share_explain") explanationLabel.numberOfLines = 0 explanationLabel.textAlignment = .center @@ -52,6 +53,8 @@ class ShareProxyViewController: UIViewController { view.backgroundColor = .secondarySystemBackground + shareLinkButton.titleLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.medium) + shareLinkButton.titleLabel?.adjustsFontForContentSizeCategory = true shareLinkButton.addTarget(self, action: #selector(ShareProxyViewController.shareInviteLink(_:)), for: .touchUpInside) let svg = dcContext.createQRSVG(for: proxyUrlString) diff --git a/deltachat-ios/Controller/Settings/SettingsViewController.swift b/deltachat-ios/Controller/Settings/SettingsViewController.swift index 64f03118e..680aca3d7 100644 --- a/deltachat-ios/Controller/Settings/SettingsViewController.swift +++ b/deltachat-ios/Controller/Settings/SettingsViewController.swift @@ -163,6 +163,12 @@ internal final class SettingsViewController: UITableViewController { // Set the main backgrounds to red view.backgroundColor = DcColors.chatBackgroundColor tableView.backgroundColor = DcColors.chatBackgroundColor + + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = DcColors.chatBackgroundColor + navigationController?.navigationBar.standardAppearance = appearance + navigationController?.navigationBar.scrollEdgeAppearance = appearance } // MARK: - lifecycle @@ -236,6 +242,15 @@ internal final class SettingsViewController: UITableViewController { override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { cell.backgroundColor = DcColors.chatBackgroundColor cell.contentView.backgroundColor = DcColors.chatBackgroundColor + if !(cell is ContactCell) { + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true + + if cell.detailTextLabel != nil { + cell.detailTextLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote,weight:PoppinsWeight.regular) + cell.detailTextLabel?.adjustsFontForContentSizeCategory = true + } + } switch indexPath.section { case 0: diff --git a/deltachat-ios/Controller/Settings/VideoChatInstanceViewController.swift b/deltachat-ios/Controller/Settings/VideoChatInstanceViewController.swift index 3cc857626..6e55fb324 100644 --- a/deltachat-ios/Controller/Settings/VideoChatInstanceViewController.swift +++ b/deltachat-ios/Controller/Settings/VideoChatInstanceViewController.swift @@ -20,6 +20,10 @@ private class PredefinedOptionCell: UITableViewCell { self.textLabel?.text = label self.detailTextLabel?.text = url self.detailTextLabel?.textColor = .lightGray + self.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + self.textLabel?.adjustsFontForContentSizeCategory = true + self.detailTextLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote, weight: PoppinsWeight.regular) + self.detailTextLabel?.adjustsFontForContentSizeCategory = true } required init?(coder: NSCoder) { @@ -38,6 +42,8 @@ class VideoChatInstanceViewController: UITableViewController { private lazy var offCell: UITableViewCell = { let cell = UITableViewCell(style: UITableViewCell.CellStyle.default, reuseIdentifier: "off") cell.textLabel?.text = String.localized("off") + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true return cell }() @@ -165,6 +171,18 @@ class VideoChatInstanceViewController: UITableViewController { return String.localized("videochat_instance_explain_2") } + override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { + let bgColor = DcColors.settingScreenBackgroundColor + cell.backgroundColor = bgColor + cell.contentView.backgroundColor = bgColor + if !(cell is TextFieldCell) { + cell.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + cell.textLabel?.adjustsFontForContentSizeCategory = true + cell.detailTextLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.footnote, weight: PoppinsWeight.regular) + cell.detailTextLabel?.adjustsFontForContentSizeCategory = true + } + } + override func viewWillDisappear(_ animated: Bool) { let customTextField = customInstanceCell.getText() dcContext.setConfig("ui.custom_webrtc_instance", customTextField) diff --git a/deltachat-ios/Coordinator/AppCoordinator.swift b/deltachat-ios/Coordinator/AppCoordinator.swift index cf2a61766..5e5414fbf 100644 --- a/deltachat-ios/Coordinator/AppCoordinator.swift +++ b/deltachat-ios/Coordinator/AppCoordinator.swift @@ -31,6 +31,12 @@ class AppCoordinator: NSObject { tabBarController.delegate = self tabBarController.viewControllers = [qrNavController, chatsNavController, settingsNavController] tabBarController.tabBar.tintColor = DcColors.privittyThemeColor + tabBarController.tabBar.backgroundColor = DcColors.chatBackgroundColor + let tabBarTitleFont = UIFont.poppins(forTextStyle: .footnote, weight: .medium) + let titleAttributes: [NSAttributedString.Key: Any] = [.font: tabBarTitleFont] + UITabBarItem.appearance().setTitleTextAttributes(titleAttributes, for: .normal) + UITabBarItem.appearance().setTitleTextAttributes(titleAttributes, for: .selected) + return tabBarController }() @@ -477,7 +483,9 @@ class AppCoordinator: NSObject { // here and in the custom chatlist title // (according to https://learnui.design/blog/ios-font-size-guidelines.html ) // Using Poppins SemiBold for navigation bar titles - UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.font: AppFont.semiBold(size: 17)] + UINavigationBar.appearance().titleTextAttributes = [ + NSAttributedString.Key.font: UIFont.poppins(.semibold, size: 17) + ] } func presentWelcomeController(accountCode: String? = nil) { diff --git a/deltachat-ios/Extensions/UIFont+Poppins.swift b/deltachat-ios/Extensions/UIFont+Poppins.swift new file mode 100644 index 000000000..d9b1d40a4 --- /dev/null +++ b/deltachat-ios/Extensions/UIFont+Poppins.swift @@ -0,0 +1,35 @@ +import UIKit + +public enum PoppinsWeight { + case regular, medium, semibold, bold + + var fontName: String { + switch self { + case .regular: return "Poppins-Regular" + case .medium: return "Poppins-Medium" + case .semibold: return "Poppins-SemiBold" + case .bold: return "Poppins-Bold" + } + } +} + +extension UIFont { + static func poppins(_ weight: PoppinsWeight = .regular, size: CGFloat) -> UIFont { + if let font = UIFont(name: weight.fontName, size: size) { + return font + } + let systemWeight: UIFont.Weight + switch weight { + case .regular: systemWeight = .regular + case .medium: systemWeight = .medium + case .semibold: systemWeight = .semibold + case .bold: systemWeight = .bold + } + return UIFont.systemFont(ofSize: size, weight: systemWeight) + } + static func poppins(forTextStyle textStyle: UIFont.TextStyle, weight: PoppinsWeight = .regular) -> UIFont { + let pointSize = UIFont.preferredFont(forTextStyle: textStyle).pointSize + let base = UIFont.poppins(weight, size: pointSize) + return UIFontMetrics(forTextStyle: textStyle).scaledFont(for: base) + } +} diff --git a/deltachat-ios/View/ActionCell.swift b/deltachat-ios/View/ActionCell.swift index bb7941c3b..bcee7bd15 100644 --- a/deltachat-ios/View/ActionCell.swift +++ b/deltachat-ios/View/ActionCell.swift @@ -24,6 +24,8 @@ class ActionCell: UITableViewCell { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) textLabel?.textColor = UIColor.systemBlue + textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + textLabel?.adjustsFontForContentSizeCategory = true } required init?(coder _: NSCoder) { diff --git a/deltachat-ios/View/AvatarSelectionCell.swift b/deltachat-ios/View/AvatarSelectionCell.swift index a1bc8f76e..b74b0c341 100644 --- a/deltachat-ios/View/AvatarSelectionCell.swift +++ b/deltachat-ios/View/AvatarSelectionCell.swift @@ -30,7 +30,8 @@ class AvatarSelectionCell: UITableViewCell { label.translatesAutoresizingMaskIntoConstraints = false label.textColor = DcColors.defaultTextColor label.text = String.localized("pref_profile_photo") - label.font = .preferredFont(forTextStyle: .body) +// label.font = .preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) label.adjustsFontForContentSizeCategory = true label.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) return label diff --git a/deltachat-ios/View/Cell/GalleryCell.swift b/deltachat-ios/View/Cell/GalleryCell.swift index 1ffc91bc8..4dd2bd785 100644 --- a/deltachat-ios/View/Cell/GalleryCell.swift +++ b/deltachat-ios/View/Cell/GalleryCell.swift @@ -11,7 +11,8 @@ class GalleryCell: UICollectionViewCell { let view = SDAnimatedImageView() view.contentMode = .scaleAspectFill view.clipsToBounds = true - view.backgroundColor = DcColors.defaultBackgroundColor + view.backgroundColor = DcColors.chatBackgroundColor +// view.backgroundColor = DcColors.defaultBackgroundColor return view }() diff --git a/deltachat-ios/View/ChatTitleView.swift b/deltachat-ios/View/ChatTitleView.swift index e4cf40232..2363dea93 100644 --- a/deltachat-ios/View/ChatTitleView.swift +++ b/deltachat-ios/View/ChatTitleView.swift @@ -6,7 +6,8 @@ class ChatTitleView: UIStackView { lazy var initialsBadge: InitialsBadge = { let badge: InitialsBadge badge = InitialsBadge(size: 37, accessibilityLabel: String.localized("menu_view_profile")) - badge.setLabelFont(AppFont.regular(size: 14)) +// badge.setLabelFont(AppFont.regular(size: 14)) + badge.setLabelFont(UIFont.poppins(.regular, size: 14)) badge.accessibilityTraits = .button return badge }() @@ -15,7 +16,8 @@ class ChatTitleView: UIStackView { let titleLabel = UILabel() titleLabel.translatesAutoresizingMaskIntoConstraints = false titleLabel.backgroundColor = UIColor.clear - titleLabel.font = AppFont.semiBold(size: 16) + titleLabel.font = UIFont.poppins(.semibold, size: 16) +// titleLabel.font = AppFont.semiBold(size: 16) titleLabel.textAlignment = .center titleLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) return titleLabel @@ -56,7 +58,8 @@ class ChatTitleView: UIStackView { private lazy var subtitleLabel: UILabel = { let subtitleLabel = UILabel() subtitleLabel.translatesAutoresizingMaskIntoConstraints = false - subtitleLabel.font = AppFont.regular(size: 12) +// subtitleLabel.font = AppFont.regular(size: 12) + subtitleLabel.font = UIFont.poppins(.regular, size: 12) subtitleLabel.textAlignment = .center return subtitleLabel }() diff --git a/deltachat-ios/View/ContactCell.swift b/deltachat-ios/View/ContactCell.swift index 879758e89..0af426bb0 100644 --- a/deltachat-ios/View/ContactCell.swift +++ b/deltachat-ios/View/ContactCell.swift @@ -9,11 +9,10 @@ class ContactCell: UITableViewCell { static let reuseIdentifier = "contact_cell_reuse_identifier" static var cellHeight: CGFloat { - let textHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize + UIFont.preferredFont(forTextStyle: .subheadline).pointSize + 24 - if textHeight > 74.5 { - return textHeight - } - return 74.5 + let textHeight = + UIFont.poppins(forTextStyle: .body, weight: .medium).pointSize + + UIFont.poppins(forTextStyle: .subheadline).pointSize + 24 + return max(textHeight, 74.5) } var isLargeText: Bool { @@ -57,7 +56,8 @@ class ContactCell: UITableViewCell { let label = UILabel() label.lineBreakMode = .byTruncatingTail label.textColor = DcColors.defaultTextColor - label.font = UIFont.preferredFont(for: .body, weight: .medium) + // label.font = UIFont.preferredFont(for: .body, weight: .medium) + label.font = UIFont.poppins(forTextStyle: .body, weight: .medium) label.adjustsFontForContentSizeCategory = true label.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 1), for: .horizontal) label.isAccessibilityElement = false @@ -98,7 +98,8 @@ class ContactCell: UITableViewCell { lazy var timeLabel: UILabel = { let label = UILabel() - label.font = UIFont.preferredFont(forTextStyle: .subheadline) + label.font = UIFont.poppins(forTextStyle: .subheadline) +// label.font = UIFont.preferredFont(forTextStyle: .subheadline) label.adjustsFontForContentSizeCategory = true label.textColor = DcColors.middleGray label.textAlignment = .right @@ -119,7 +120,8 @@ class ContactCell: UITableViewCell { let label = UILabel() label.textColor = DcColors.middleGray label.lineBreakMode = .byTruncatingTail - label.font = .preferredFont(forTextStyle: .subheadline) + label.font = .poppins(forTextStyle: .subheadline) +// label.font = .preferredFont(forTextStyle: .subheadline) label.adjustsFontForContentSizeCategory = true label.isAccessibilityElement = false return label @@ -163,7 +165,8 @@ class ContactCell: UITableViewCell { private func createTagLabel(tag: String) -> UIView { let tintColor = UIColor(hexString: "848ba7") let label = UILabel() - label.font = label.font.withSize(14) +// label.font = label.font.withSize(14) + label.font = UIFont.poppins(.medium, size: 14) label.text = tag label.textColor = tintColor label.setContentHuggingPriority(.defaultHigh, for: NSLayoutConstraint.Axis.horizontal) // needed so label does not expand to available space @@ -365,7 +368,7 @@ class ContactCell: UITableViewCell { if visibility == DC_CHAT_VISIBILITY_PINNED { backgroundColor = DcColors.deaddropBackground } else { - backgroundColor = DcColors.contactCellBackgroundColor + backgroundColor = DcColors.chatBackgroundColor } if let img = chat.profileImage { resetBackupImage() @@ -389,6 +392,7 @@ class ContactCell: UITableViewCell { let contact = cellViewModel.dcContext.getContact(id: contactData.contactId) titleLabel.attributedText = cellViewModel.title.boldAt(indexes: cellViewModel.titleHighlightIndexes, fontSize: titleLabel.font.pointSize) subtitleLabel.isHidden = contact.isKeyContact + backgroundColor = DcColors.chatBackgroundColor if let profileImage = contact.profileImage { avatar.setImage(profileImage) @@ -408,6 +412,7 @@ class ContactCell: UITableViewCell { let contact = cellViewModel.dcContext.getContact(id: Int(DC_CONTACT_ID_SELF)) titleLabel.text = cellViewModel.title subtitleLabel.text = cellViewModel.subtitle + backgroundColor = DcColors.chatBackgroundColor if let profileImage = contact.profileImage { avatar.setImage(profileImage) } else { diff --git a/deltachat-ios/View/InitialsBadge.swift b/deltachat-ios/View/InitialsBadge.swift index b54bd40d5..f53319081 100644 --- a/deltachat-ios/View/InitialsBadge.swift +++ b/deltachat-ios/View/InitialsBadge.swift @@ -71,6 +71,7 @@ public class InitialsBadge: UIView { translatesAutoresizingMaskIntoConstraints = false heightAnchor.constraint(equalToConstant: size).isActive = true widthAnchor.constraint(equalToConstant: size).isActive = true +// label.font = UIFont.poppins(.medium, size: size * 3 / 5) label.font = AppFont.regular(size: size * 3 / 5) setupSubviews(with: radius) isAccessibilityElement = true diff --git a/deltachat-ios/View/MultilineLabelCell.swift b/deltachat-ios/View/MultilineLabelCell.swift index 6abac445e..995cc6d61 100644 --- a/deltachat-ios/View/MultilineLabelCell.swift +++ b/deltachat-ios/View/MultilineLabelCell.swift @@ -9,7 +9,8 @@ class MultilineLabelCell: UITableViewCell { let label = MessageLabel() label.delegate = self label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.preferredFont(for: .body, weight: .regular) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) +// label.font = UIFont.preferredFont(for: .body, weight: .regular) label.numberOfLines = 0 label.lineBreakMode = .byWordWrapping label.isUserInteractionEnabled = true @@ -64,7 +65,9 @@ class MultilineLabelCell: UITableViewCell { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { if previousTraitCollection?.preferredContentSizeCategory != traitCollection.preferredContentSizeCategory { - label.font = UIFont.preferredFont(for: .body, weight: .regular) + label.font = UIFont.poppins(forTextStyle: .body, weight: .regular) + label.adjustsFontForContentSizeCategory = true +// label.font = UIFont.preferredFont(for: .body, weight: .regular) } } } diff --git a/deltachat-ios/View/MultilineTextFieldCell.swift b/deltachat-ios/View/MultilineTextFieldCell.swift index 7229f7add..5214df206 100644 --- a/deltachat-ios/View/MultilineTextFieldCell.swift +++ b/deltachat-ios/View/MultilineTextFieldCell.swift @@ -18,7 +18,7 @@ class MultilineTextFieldCell: UITableViewCell, UITextViewDelegate { textField.translatesAutoresizingMaskIntoConstraints = false textField.isEnabled = false textField.adjustsFontForContentSizeCategory = true - textField.font = .preferredFont(forTextStyle: .body) + textField.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) return textField }() @@ -27,7 +27,7 @@ class MultilineTextFieldCell: UITableViewCell, UITextViewDelegate { textField.delegate = self textField.translatesAutoresizingMaskIntoConstraints = false textField.adjustsFontForContentSizeCategory = true - textField.font = .preferredFont(forTextStyle: .body) + textField.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) textField.backgroundColor = .none return textField }() @@ -37,7 +37,7 @@ class MultilineTextFieldCell: UITableViewCell, UITextViewDelegate { placeholderLabel.textColor = UIColor.lightGray placeholderLabel.translatesAutoresizingMaskIntoConstraints = false placeholderLabel.adjustsFontForContentSizeCategory = true - placeholderLabel.font = .preferredFont(forTextStyle: .body) + placeholderLabel.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) return placeholderLabel }() diff --git a/deltachat-ios/View/ProfileHeader.swift b/deltachat-ios/View/ProfileHeader.swift index d4df8a8dd..1e5acd056 100644 --- a/deltachat-ios/View/ProfileHeader.swift +++ b/deltachat-ios/View/ProfileHeader.swift @@ -22,7 +22,7 @@ class ProfileHeader: UIStackView { label.lineBreakMode = .byTruncatingTail label.textColor = DcColors.defaultTextColor - let baseFont = UIFont.preferredFont(forTextStyle: .title1) + let baseFont = UIFont.poppins(forTextStyle: .title1) if let descriptor = baseFont.fontDescriptor.withSymbolicTraits(.traitBold) { label.font = UIFont(descriptor: descriptor, size: descriptor.pointSize) } @@ -44,7 +44,8 @@ class ProfileHeader: UIStackView { let label = UILabel() label.lineBreakMode = .byTruncatingTail label.textColor = DcColors.defaultTextColor - label.font = UIFont.preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: .body,) +// label.font = UIFont.preferredFont(forTextStyle: .body) label.translatesAutoresizingMaskIntoConstraints = false return label }() diff --git a/deltachat-ios/View/ProviderInfoCell.swift b/deltachat-ios/View/ProviderInfoCell.swift index 202bab547..d24a31dd3 100644 --- a/deltachat-ios/View/ProviderInfoCell.swift +++ b/deltachat-ios/View/ProviderInfoCell.swift @@ -35,7 +35,8 @@ class ProviderInfoCell: UITableViewCell { private lazy var hintLabel: UILabel = { let label = UILabel() label.numberOfLines = 0 - label.font = AppFont.regular(size: fontSize) +// label.font = AppFont.regular(size: fontSize) + label.font = UIFont.poppins(.regular, size: fontSize) return label }() @@ -43,7 +44,8 @@ class ProviderInfoCell: UITableViewCell { let button = UIButton() let title = String.localized("more_info_desktop") button.setTitle(title, for: .normal) - button.titleLabel?.font = UIFont.boldSystemFont(ofSize: fontSize) + button.titleLabel?.font = UIFont.poppins(.bold, size: fontSize) +// button.titleLabel?.font = UIFont.boldSystemFont(ofSize: fontSize) button.addTarget(self, action: #selector(infoButtonPressed(_:)), for: .touchUpInside) return button }() diff --git a/deltachat-ios/View/SwitchCell.swift b/deltachat-ios/View/SwitchCell.swift index 3616832fa..caa5308d1 100644 --- a/deltachat-ios/View/SwitchCell.swift +++ b/deltachat-ios/View/SwitchCell.swift @@ -15,9 +15,11 @@ class SwitchCell: UITableViewCell { self.action = action super.init(style: .value1, reuseIdentifier: nil) - self.uiSwitch.setOn(on, animated: false) + self.uiSwitch.setOn (on, animated: false) self.uiSwitch.addTarget(self, action: #selector(SwitchCell.didToggleSwitch(_:)), for: .valueChanged) self.textLabel?.text = textLabel + self.textLabel?.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) + self.textLabel?.adjustsFontForContentSizeCategory = true self.accessoryView = uiSwitch self.selectionStyle = .none } diff --git a/deltachat-ios/View/TextFieldCell.swift b/deltachat-ios/View/TextFieldCell.swift index 4c93e8563..f71009136 100644 --- a/deltachat-ios/View/TextFieldCell.swift +++ b/deltachat-ios/View/TextFieldCell.swift @@ -37,7 +37,7 @@ class TextFieldCell: UITableViewCell { public lazy var title: UILabel = { let label = UILabel() - label.font = .preferredFont(forTextStyle: .body) + label.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) label.adjustsFontForContentSizeCategory = true label.textColor = DcColors.defaultTextColor label.lineBreakMode = .byTruncatingTail @@ -52,7 +52,7 @@ class TextFieldCell: UITableViewCell { textField.textAlignment = .right textField.addTarget(self, action: #selector(textFieldChanged), for: .editingChanged) textField.adjustsFontForContentSizeCategory = true - textField.font = .preferredFont(forTextStyle: .body) + textField.font = UIFont.poppins(forTextStyle: UIFont.TextStyle.body, weight: PoppinsWeight.regular) textField.translatesAutoresizingMaskIntoConstraints = false textField.delegate = self return textField