Change Feeds background color and update to emulate plain style tables more closely. Issue #1224

This commit is contained in:
Maurice Parker
2019-11-01 06:34:26 -05:00
parent b78b996e88
commit 5720034f19
4 changed files with 38 additions and 28 deletions

View File

@@ -32,27 +32,28 @@ class ThemedNavigationController: UINavigationController {
private func configure() {
isToolbarHidden = false
if traitCollection.userInterfaceStyle == .dark {
navigationBar.standardAppearance = UINavigationBarAppearance()
navigationBar.tintColor = AppAssets.primaryAccentColor
toolbar.standardAppearance = UIToolbarAppearance()
toolbar.compactAppearance = UIToolbarAppearance()
toolbar.tintColor = AppAssets.primaryAccentColor
} else {
let navigationAppearance = UINavigationBarAppearance()
navigationAppearance.backgroundColor = AppAssets.barBackgroundColor
navigationAppearance.titleTextAttributes = [.foregroundColor: UIColor.label]
navigationAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label]
navigationBar.standardAppearance = navigationAppearance
navigationBar.tintColor = AppAssets.primaryAccentColor
let toolbarAppearance = UIToolbarAppearance()
toolbarAppearance.backgroundColor = UIColor.white
toolbar.standardAppearance = toolbarAppearance
toolbar.compactAppearance = toolbarAppearance
toolbar.tintColor = AppAssets.primaryAccentColor
}
let navigationAppearance = UINavigationBarAppearance()
let backgroundImage = AppAssets.barBackgroundColor.image()
navigationAppearance.backgroundImage = backgroundImage
navigationAppearance.titleTextAttributes = [.foregroundColor: UIColor.label]
navigationAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label]
navigationBar.standardAppearance = navigationAppearance
navigationBar.tintColor = AppAssets.primaryAccentColor
let toolbarAppearance = UIToolbarAppearance()
toolbarAppearance.backgroundImage = backgroundImage
toolbar.standardAppearance = toolbarAppearance
toolbar.compactAppearance = toolbarAppearance
toolbar.tintColor = AppAssets.primaryAccentColor
}
}
extension UIColor {
func image(_ size: CGSize = CGSize(width: 1, height: 1)) -> UIImage {
return UIGraphicsImageRenderer(size: size).image { rendererContext in
self.setFill()
rendererContext.fill(CGRect(origin: .zero, size: size))
}
}
}