Change primary colors

pull/28/head
Hwee-Boon Yar 7 years ago
parent bb40dba5a1
commit 9ff509fdf7
  1. 2
      Trust/Accounts/Views/AccountViewCell.swift
  2. 2
      Trust/Extensions/UIViewController.swift
  3. 35
      Trust/Settings/ViewControllers/SettingsViewController.swift
  4. 9
      Trust/Style/AppStyle.swift
  5. 12
      Trust/UI/Button.swift
  6. 6
      Trust/UI/StateViewModel.swift

@ -24,7 +24,7 @@ class AccountViewCell: UITableViewCell {
glassesImageView.isHidden = !model.isWatch
activeView.isHidden = !model.isActive
addressLable.text = model.title
infoButton.tintColor = Colors.lightBlue
infoButton.tintColor = Colors.appBackground
}
}
override func prepareForReuse() {

@ -57,7 +57,7 @@ extension UIViewController {
func openURL(_ url: URL) {
let controller = SFSafariViewController(url: url)
controller.preferredBarTintColor = Colors.darkBlue
controller.preferredBarTintColor = Colors.appBackground
present(controller, animated: true, completion: nil)
}
}

@ -69,16 +69,19 @@ class SettingsViewController: FormViewController {
}
}
}.cellSetup { cell, _ in
cell.imageView?.image = R.image.settings_server()
cell.imageView?.tintColor = Colors.appBackground
cell.imageView?.image = R.image.settings_server()?.withRenderingMode(.alwaysTemplate)
}
<<< AppFormAppearance.button { button in
button.cellStyle = .value1
}.onCellSelection { [unowned self] _, _ in
self.run(action: .wallets)
}.cellSetup { cell, _ in
cell.imageView?.tintColor = Colors.appBackground
}.cellUpdate { cell, _ in
cell.textLabel?.textColor = .black
cell.imageView?.image = R.image.settings_wallet()
cell.imageView?.image = R.image.settings_wallet()?.withRenderingMode(.alwaysTemplate)
cell.textLabel?.text = NSLocalizedString("settings.wallets.button.title", value: "Wallets", comment: "")
cell.detailTextLabel?.text = String(account.address.description.prefix(10)) + "..."
cell.accessoryType = .disclosureIndicator
@ -99,7 +102,8 @@ class SettingsViewController: FormViewController {
self.lock.deletePasscode()
}
}.cellSetup { cell, _ in
cell.imageView?.image = R.image.settings_lock()
cell.imageView?.tintColor = Colors.appBackground
cell.imageView?.image = R.image.settings_lock()?.withRenderingMode(.alwaysTemplate)
}
<<< SwitchRow {
@ -109,7 +113,8 @@ class SettingsViewController: FormViewController {
let enabled = row.value ?? false
self.run(action: .pushNotifications(enabled: enabled))
}.cellSetup { cell, _ in
cell.imageView?.image = R.image.settings_push_notifications()
cell.imageView?.tintColor = Colors.appBackground
cell.imageView?.image = R.image.settings_push_notifications()?.withRenderingMode(.alwaysTemplate)
}
+++ Section()
@ -149,7 +154,8 @@ class SettingsViewController: FormViewController {
}
}
}.cellSetup { cell, _ in
cell.imageView?.image = R.image.settingsCurrency()
cell.imageView?.tintColor = Colors.appBackground
cell.imageView?.image = R.image.settingsCurrency()?.withRenderingMode(.alwaysTemplate)
}
<<< AppFormAppearance.button { row in
@ -157,9 +163,11 @@ class SettingsViewController: FormViewController {
row.presentationMode = .show(controllerProvider: ControllerProvider<UIViewController>.callback {
return PreferencesViewController() }, onDismiss: { _ in
})
}.cellSetup { cell, _ in
cell.imageView?.tintColor = Colors.appBackground
}.cellUpdate { cell, _ in
cell.textLabel?.textColor = .black
cell.imageView?.image = R.image.settings_preferences()
cell.imageView?.image = R.image.settings_preferences()?.withRenderingMode(.alwaysTemplate)
cell.textLabel?.text = NSLocalizedString("settings.preferences.title", value: "Preferences", comment: "")
cell.accessoryType = .disclosureIndicator
}
@ -188,7 +196,8 @@ class SettingsViewController: FormViewController {
<<< AppFormAppearance.button { button in
button.title = NSLocalizedString("settings.shareWithFriends.button.title", value: "Share With Friends", comment: "")
button.cell.imageView?.image = R.image.settingsShare()
button.cell.imageView?.tintColor = Colors.appBackground
button.cell.imageView?.image = R.image.settingsShare()?.withRenderingMode(.alwaysTemplate)
}.onCellSelection { [unowned self] cell, _ in
self.helpUsCoordinator.presentSharing(in: self, from: cell.contentView)
}
@ -198,7 +207,8 @@ class SettingsViewController: FormViewController {
}.onCellSelection {[weak self] _, _ in
self?.helpUsCoordinator.rateUs()
}.cellSetup { cell, _ in
cell.imageView?.image = R.image.settings_rating()
cell.imageView?.tintColor = Colors.appBackground
cell.imageView?.image = R.image.settings_rating()?.withRenderingMode(.alwaysTemplate)
}
<<< AppFormAppearance.button { button in
@ -206,7 +216,8 @@ class SettingsViewController: FormViewController {
}.onCellSelection {[weak self] _, _ in
self?.sendUsEmail()
}.cellSetup { cell, _ in
cell.imageView?.image = R.image.settings_email()
cell.imageView?.tintColor = Colors.appBackground
cell.imageView?.image = R.image.settings_email()?.withRenderingMode(.alwaysTemplate)
}
+++ Section(NSLocalizedString("settings.learnMore.label.title", value: "Learn More", comment: ""))
@ -259,7 +270,8 @@ class SettingsViewController: FormViewController {
self.openURL(type.remoteURL)
}
}.cellSetup { cell, _ in
cell.imageView?.image = type.image
cell.imageView?.tintColor = Colors.appBackground
cell.imageView?.image = type.image?.withRenderingMode(.alwaysTemplate)
}
}
@ -275,7 +287,8 @@ class SettingsViewController: FormViewController {
guard let value = row.value, let url = URL(string: value) else { return }
self.openURL(url)
}.cellSetup { cell, _ in
cell.imageView?.image = image
cell.imageView?.tintColor = Colors.appBackground
cell.imageView?.image = image?.withRenderingMode(.alwaysTemplate)
}
}

@ -10,13 +10,15 @@ func applyStyle() {
} else {
UINavigationBar.appearance().isTranslucent = false
}
UIWindow.appearance().tintColor = Colors.appBackground
UINavigationBar.appearance().tintColor = UIColor.white
UINavigationBar.appearance().setBackgroundImage(.filled(with: Colors.darkBlue), for: .default)
UINavigationBar.appearance().setBackgroundImage(.filled(with: Colors.appBackground), for: .default)
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().titleTextAttributes = [
.foregroundColor: UIColor.white,
]
UITextField.appearance().tintColor = Colors.blue
UIImageView.appearance().tintColor = Colors.lightBlue
@ -40,6 +42,9 @@ struct Colors {
static let black = UIColor(hex: "313849")
static let lightBlack = UIColor(hex: "313849")
static let lightBlue = UIColor(hex: "007aff")
static let appBackground = UIColor(red: 84, green: 193, blue: 227)
static let appWhite = UIColor.white
static let appText = UIColor(red: 47, green: 47, blue: 47)
}
struct StyleLayout {

@ -27,15 +27,15 @@ enum ButtonStyle: Int {
var backgroundColor: UIColor {
switch self {
case .solid, .squared: return Colors.blue
case .solid, .squared: return Colors.appBackground
case .border, .borderless: return .white
}
}
var backgroundColorHighlighted: UIColor {
switch self {
case .solid, .squared: return Colors.blue
case .border: return Colors.blue
case .solid, .squared: return Colors.appBackground
case .border: return Colors.appBackground
case .borderless: return .white
}
}
@ -60,7 +60,7 @@ enum ButtonStyle: Int {
var textColor: UIColor {
switch self {
case .solid, .squared: return .white
case .border, .borderless: return Colors.blue
case .border, .borderless: return Colors.appBackground
}
}
@ -68,13 +68,13 @@ enum ButtonStyle: Int {
switch self {
case .solid, .squared: return UIColor(white: 1, alpha: 0.8)
case .border: return .white
case .borderless: return Colors.blue
case .borderless: return Colors.appBackground
}
}
var borderColor: UIColor {
switch self {
case .solid, .squared, .border: return Colors.blue
case .solid, .squared, .border: return Colors.appBackground
case .borderless: return .clear
}
}

@ -6,15 +6,15 @@ import UIKit
struct StateViewModel {
var titleTextColor: UIColor {
return UIColor(hex: "438FCA")
}
return Colors.appBackground
}
var titleFont: UIFont {
return UIFont.systemFont(ofSize: 18, weight: UIFont.Weight.medium)
}
var descriptionTextColor: UIColor {
return UIColor(hex: "69A5D5")
return Colors.appBackground
}
var descriptionFont: UIFont {

Loading…
Cancel
Save