Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 27 additions & 13 deletions FlowCrypt/Controllers/Search/SearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,51 @@ class SearchViewController: InboxViewController {

override func setupNavigationBar() {
title = "search_title".localized
navigationItem.titleView = searchController.searchBar
navigationItem.rightBarButtonItems = nil
navigationItem.leftBarButtonItem = .defaultBackButton {
self.navigationController?.popViewController(animated: true)
}

if #available(iOS 26.0, *) {
navigationItem.searchController = searchController
navigationItem.hidesSearchBarWhenScrolling = false
} else {
navigationItem.titleView = searchController.searchBar
}
}

private func setupSearch() {
searchController.do {
$0.delegate = self
$0.searchResultsUpdater = self
$0.hidesNavigationBarDuringPresentation = false
$0.searchBar.tintColor = .white
$0.searchBar.setImage(UIImage(systemName: "magnifyingglass")?.tinted(.white), for: .search, state: .normal)
$0.searchBar.setImage(UIImage(systemName: "xmark")?.tinted(.white), for: .clear, state: .normal)
$0.searchBar.delegate = self
$0.searchBar.searchTextField.textColor = .white
}

if #unavailable(iOS 26.0) {
searchController.do {
$0.searchBar.tintColor = .white
$0.searchBar.setImage(UIImage(systemName: "magnifyingglass")?.tinted(.white), for: .search, state: .normal)
$0.searchBar.setImage(UIImage(systemName: "xmark")?.tinted(.white), for: .clear, state: .normal)
$0.searchBar.searchTextField.textColor = .white
}
}

update(searchController: searchController)
definesPresentationContext = true
}

private func update(searchController: UISearchController) {
searchController.searchBar.searchTextField.attributedPlaceholder = "search_placeholder"
.localized
.attributed(
.regular(14),
color: UIColor.white.withAlphaComponent(0.7),
alignment: .left
)
searchController.searchBar.searchTextField.textColor = .white
if #unavailable(iOS 26.0) {
searchController.searchBar.searchTextField.attributedPlaceholder = "search_placeholder"
.localized
.attributed(
.regular(14),
color: UIColor.white.withAlphaComponent(0.7),
alignment: .left
)
searchController.searchBar.searchTextField.textColor = .white
}
searchController.searchBar.searchTextField.accessibilityIdentifier = "aid-search-all-emails-field"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ final class SetupManuallyEnterPassPhraseViewController: TableNodeViewController,
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
navigationController?.navigationBar.barStyle = .black
}

private func setupUI() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ final class SetupManuallyImportKeyViewController: TableNodeViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
navigationController?.navigationBar.barStyle = .black
}

override func viewDidAppear(_ animated: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ final class SideMenuNavigationController: ENSideMenuNavigationController {
}

override var preferredStatusBarStyle: UIStatusBarStyle {
.lightContent
if #available(iOS 26.0, *) {
return .default
}
return .lightContent
}

override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,30 @@ extension UINavigationController {
.then { $0.title = "" }
navigationBar.backItem?.title = ""

let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .main
appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navigationBar.standardAppearance = appearance
navigationBar.scrollEdgeAppearance = appearance
navigationBar.compactScrollEdgeAppearance = appearance
if #available(iOS 26.0, *) {
let appearance = UINavigationBarAppearance()
appearance.configureWithTransparentBackground()
navigationBar.standardAppearance = appearance
navigationBar.scrollEdgeAppearance = appearance
navigationBar.compactAppearance = appearance
navigationBar.compactScrollEdgeAppearance = appearance

navigationBar.do {
$0.barTintColor = .main
$0.tintColor = .white
$0.titleTextAttributes = [.foregroundColor: UIColor.white]
navigationBar.tintColor = .main
} else {
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .main
appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navigationBar.standardAppearance = appearance
navigationBar.scrollEdgeAppearance = appearance
navigationBar.compactAppearance = appearance
navigationBar.compactScrollEdgeAppearance = appearance

navigationBar.do {
$0.barTintColor = .main
$0.tintColor = .white
$0.titleTextAttributes = [.foregroundColor: UIColor.white]
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions FlowCrypt/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDesignRequiresCompatibility</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
Expand Down
8 changes: 7 additions & 1 deletion FlowCryptUI/Nodes/TableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,16 @@ open class TableNodeViewController: ASDKViewController<TableNode> {

public extension UINavigationItem {
func setAccessibility(id: String?) {
let titleColor: UIColor
if #available(iOS 26.0, *) {
titleColor = .main
} else {
titleColor = .white
}
let titleLabel = UILabel()
titleLabel.attributedText = id?.attributed(
.medium(16),
color: .white,
color: titleColor,
alignment: .center
)
titleLabel.sizeToFit()
Expand Down
23 changes: 16 additions & 7 deletions FlowCryptUI/Views/NavigationBarActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ public final class NavigationBarActionButton: UIBarButtonItem {
public convenience init(imageSystemName: String, action: (() -> Void)?, accessibilityIdentifier: String? = nil) {
self.init()
onAction = action
customView = UIButton(type: .system).with {
$0.contentHorizontalAlignment = .left
$0.setImage(UIImage(systemName: imageSystemName), for: .normal)
$0.frame.size = Constants.buttonSize
$0.addTarget(self, action: #selector(tap), for: .touchUpInside)
$0.accessibilityIdentifier = accessibilityIdentifier
$0.isAccessibilityElement = true
if #available(iOS 26.0, *) {
image = UIImage(systemName: imageSystemName)
tintColor = .main
target = self
self.action = #selector(tap)
self.accessibilityIdentifier = accessibilityIdentifier
isAccessibilityElement = true
} else {
customView = UIButton(type: .system).with {
$0.contentHorizontalAlignment = .left
$0.setImage(UIImage(systemName: imageSystemName), for: .normal)
$0.frame.size = Constants.buttonSize
$0.addTarget(self, action: #selector(tap), for: .touchUpInside)
$0.accessibilityIdentifier = accessibilityIdentifier
$0.isAccessibilityElement = true
}
}
}

Expand Down
Loading