Commit 91df9c06 authored by Martin's avatar Martin
Browse files

Merge branch 'IOS-2897'

parents d55c0063 d85d03db
......@@ -109,6 +109,9 @@ extension CWIMAPMessage {
if let fileName = attachmentObj.filename {
if let cid = fileName.extractCid() {
part.setContentID("<\(cid)>")
let placeholderFilename = NSLocalizedString("image",
comment: "Placeholder filename used for inlined images (as the real filename is lost due to the Engine message having only one field for content-id, filename and name)")
part.setFilename(placeholderFilename)
} else {
let theFilePart = fileName.extractFileName() ?? fileName
part.setFilename(theFilePart)
......
......@@ -95,10 +95,6 @@ class CreditsWebViewController: PEPWebViewController {
private func thanxRows() -> String {
let names = ["pEpEngine",
"Libassuan",
"Libksba",
"Libcurl",
"Libiconv",
"LibEtPan",
"Pantomime (GNUStep)",
"Pantomime (github)",
......@@ -109,10 +105,6 @@ class CreditsWebViewController: PEPWebViewController {
"Sequoia-PGP",
"AlignedCollectionViewFlowLayout"]
let links = ["https://gitea.pep.foundation/pEp.foundation/pEpEngine",
"https://gnupg.org/related_software/libassuan",
"https://gnupg.org/related_software/libksba",
"https://curl.haxx.se/libcurl/",
"https://www.gnu.org/software/libiconv/",
"https://www.etpan.org/libetpan.html",
"http://wiki.gnustep.org/index.php/Pantomime",
"https://github.com/timburks/Pantomime",
......
......@@ -23,6 +23,7 @@ class Appearance {
// therefore we use the new appearance API to customise explicitly.
let normalNavigationBar = UINavigationBar.appearance()
normalNavigationBar.standardAppearance = navigationBarAppearanceDefault(color: UIColor.label)
normalNavigationBar.scrollEdgeAppearance = normalNavigationBar.standardAppearance
} else {
UINavigationBar.appearance().backgroundColor = .white
UINavigationBar.appearance().titleTextAttributes = titleTextAttributes()
......@@ -31,6 +32,13 @@ class Appearance {
UIToolbar.appearance().backgroundColor = .pEpGreen
UIToolbar.appearance().barTintColor = .pEpGreen
UIToolbar.appearance().tintColor = .white
if #available(iOS 15.0, *) {
let appearance = UIToolbarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .pEpGreen
UIToolbar.appearance().standardAppearance = appearance
UIToolbar.appearance().scrollEdgeAppearance = UIToolbar.appearance().standardAppearance
}
UITextView.appearance().tintColor = .pEpGreen
UITextField.appearance().tintColor = .pEpGreen
......@@ -56,6 +64,8 @@ class Appearance {
}
}
/// Configure the background view of the table view cells.
/// - Parameter tableViewCell: The cell to set the background view.
public static func configureSelectedBackgroundViewForPep(tableViewCell: UITableViewCell) {
var backgroundColor: UIColor
if #available(iOS 13.0, *) {
......@@ -68,6 +78,33 @@ class Appearance {
tableViewCell.selectedBackgroundView = tableViewCellSelectedbackgroundView
}
/// Customises a tutorial view controller's navigation bar appearance.
/// - Parameter viewController: UIViewController: The view controller to customize.
@available(iOS 13, *)
static public func customiseForTutorial(viewController: UIViewController) {
customiseNavigationBar(viewController: viewController) { appearance in
customiseForTutorial(navigationBarAppearance: appearance)
if #available(iOS 15, *) {
viewController.navigationController?.navigationBar.standardAppearance = appearance
viewController.navigationController?.navigationBar.scrollEdgeAppearance = appearance
}
}
}
/// Customises a login view controller's navigation bar appearance.
/// - Parameter viewController: UIViewController: The view controller to customize.
@available(iOS 13, *)
public static func customiseForLogin(viewController: UIViewController) {
customiseNavigationBar(viewController: viewController) { appearance in
customiseForLogin(navigationBarAppearance: appearance)
}
}
}
//MARK: - Private
extension Appearance {
private static func setAlertControllerTintColor(_ color: UIColor = .pEpGreen) {
let view = UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self])
view.tintColor = color
......@@ -95,6 +132,7 @@ class Appearance {
appearance.doneButtonAppearance.normal.titleTextAttributes = buttonsAttributes
let chevronLeftImg = UIImage(named: "chevron-icon-left")?
.resizeImage(targetSize: CGSize(width: 15, height: 25))
appearance.setBackIndicatorImage(chevronLeftImg, transitionMaskImage: chevronLeftImg)
return appearance
}
......@@ -111,6 +149,15 @@ class Appearance {
navigationBarAppearance.doneButtonAppearance.normal.titleTextAttributes = titleTextAttributes
}
/// Customises a navigation bar appearance for the tutorial view.
/// - Parameter navigationBarAppearance: The appearance to customize.
@available(iOS 13, *)
static private func customiseForTutorial(navigationBarAppearance: UINavigationBarAppearance) {
navigationBarAppearance.configureWithOpaqueBackground()
navigationBarAppearance.backgroundColor = UIColor.pEpGreen
customiseButtons(navigationBarAppearance: navigationBarAppearance)
}
/// Customises a navigation bar appearance for the login view.
/// - Parameter navigationBarAppearance: The appearance to customize.
@available(iOS 13, *)
......@@ -122,15 +169,6 @@ class Appearance {
customiseButtons(navigationBarAppearance: navigationBarAppearance)
}
/// Customises a navigation bar appearance for the tutorial view.
/// - Parameter navigationBarAppearance: The appearance to customize.
@available(iOS 13, *)
static private func customiseForTutorial(navigationBarAppearance: UINavigationBarAppearance) {
navigationBarAppearance.configureWithOpaqueBackground()
navigationBarAppearance.backgroundColor = UIColor.pEpGreen
customiseButtons(navigationBarAppearance: navigationBarAppearance)
}
/// Helper for changing the appearance of a navigation bar containing a view controller.
/// - Parameter viewController: The view controller that is embedded in a navigation controller.
/// - Parameter appearanceModifier: A block that will modify the navigation bar appearance.
......@@ -143,22 +181,4 @@ class Appearance {
viewController.navigationItem.standardAppearance = appearance
}
}
/// Customises a tutorial view controller's navigation bar appearance.
/// - Parameter viewController: UIViewController: The view controller to customize.
@available(iOS 13, *)
static func customiseForTutorial(viewController: UIViewController) {
customiseNavigationBar(viewController: viewController) { appearance in
customiseForTutorial(navigationBarAppearance: appearance)
}
}
/// Customises a login view controller's navigation bar appearance.
/// - Parameter viewController: UIViewController: The view controller to customize.
@available(iOS 13, *)
static func customiseForLogin(viewController: UIViewController) {
customiseNavigationBar(viewController: viewController) { appearance in
customiseForLogin(navigationBarAppearance: appearance)
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment