From 716653c23595651accf6ae2b035d38b2261433d3 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 18 Jun 2019 18:31:37 -0500 Subject: [PATCH] Implement NetNewsWire Blue for cell selection and tint. Issue #691 & #692 --- iOS/AppAssets.swift | 13 ++----- iOS/AppDelegate.swift | 2 + .../Cell/MasterFeedTableViewCell.swift | 2 +- .../Cell/MasterTimelineCellLayout.swift | 4 +- .../Cell/MasterTimelineTableViewCell.swift | 2 +- .../MasterTimelineViewController.swift | 2 +- .../feedColor.colorset/Contents.json | 20 ---------- .../Contents.json | 38 +++++++++++++++++++ .../Contents.json | 20 ---------- .../UIKit/DetailAccountViewController.swift | 2 +- .../UIKit/RefreshIntervalViewController.swift | 2 +- .../UIKit/SettingsViewController.swift | 2 +- .../TimelineNumberOfLinesViewController.swift | 2 +- 13 files changed, 53 insertions(+), 58 deletions(-) delete mode 100644 iOS/Resources/Assets.xcassets/feedColor.colorset/Contents.json create mode 100644 iOS/Resources/Assets.xcassets/netNewsWireBlueColor.colorset/Contents.json delete mode 100644 iOS/Resources/Assets.xcassets/selectionBackgroundColor.colorset/Contents.json diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index 9e7ee9c60..a0ce2fc62 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -36,26 +36,21 @@ struct AppAssets { return RSImage(named: "faviconTemplateImage")! }() - static var feedColor: UIColor = { - return UIColor(named: "feedColor")! - }() - static var feedImage: RSImage = { - let image = RSImage(named: "feedImage")! - return image.maskWithColor(color: AppAssets.feedColor.cgColor)! + return RSImage(named: "feedImage")! }() static var masterFolderColor: UIColor = { return UIColor(named: "masterFolderColor")! }() - + static var masterFolderImage: RSImage = { let image = RSImage(named: "folderImage")! return image.maskWithColor(color: AppAssets.masterFolderColor.cgColor)! }() - static var selectionBackgroundColor: UIColor = { - return UIColor(named: "selectionBackgroundColor")! + static var netNewsWireBlueColor: UIColor = { + return UIColor(named: "netNewsWireBlueColor")! }() static var smartFeedColor: UIColor = { diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 0fa232d3f..0f1bc5551 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -71,6 +71,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem splitViewController.delegate = self + window!.tintColor = AppAssets.netNewsWireBlueColor + AppDefaults.registerDefaults() let isFirstRun = AppDefaults.isFirstRun if isFirstRun { diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift index 492f9d350..7f34a65cc 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift @@ -144,7 +144,7 @@ private extension MasterFeedTableViewCell { func theme() { let bgView = UIView() - bgView.backgroundColor = AppAssets.selectionBackgroundColor + bgView.backgroundColor = AppAssets.netNewsWireBlueColor selectedBackgroundView = bgView } diff --git a/iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift b/iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift index 1b8066be7..f4b25aff5 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineCellLayout.swift @@ -28,7 +28,7 @@ extension MasterTimelineCellLayout { var r = CGRect.zero r.size = CGSize(width: MasterTimelineDefaultCellLayout.unreadCircleDimension, height: MasterTimelineDefaultCellLayout.unreadCircleDimension) r.origin.x = point.x - r.origin.y = point.y + 4 + r.origin.y = point.y + 5 return r } @@ -38,7 +38,7 @@ extension MasterTimelineCellLayout { r.size.width = MasterTimelineDefaultCellLayout.starDimension r.size.height = MasterTimelineDefaultCellLayout.starDimension r.origin.x = floor(point.x - ((MasterTimelineDefaultCellLayout.starDimension - MasterTimelineDefaultCellLayout.unreadCircleDimension) / 2.0)) - r.origin.y = point.y + 2 + r.origin.y = point.y + 3 return r } diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index 58b55beda..d87dddece 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -123,7 +123,7 @@ private extension MasterTimelineTableViewCell { func theme() { let bgView = UIView() - bgView.backgroundColor = AppAssets.selectionBackgroundColor + bgView.backgroundColor = AppAssets.netNewsWireBlueColor selectedBackgroundView = bgView } diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 0ac2aa9cf..4b35170a8 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -139,7 +139,7 @@ class MasterTimelineViewController: ProgressTableViewController, UndoableCommand } readAction.image = AppAssets.circleClosedImage - readAction.backgroundColor = AppAssets.timelineUnreadCircleColor + readAction.backgroundColor = AppAssets.netNewsWireBlueColor // Set up the star action let starTitle = article.status.starred ? diff --git a/iOS/Resources/Assets.xcassets/feedColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/feedColor.colorset/Contents.json deleted file mode 100644 index 54b47afc7..000000000 --- a/iOS/Resources/Assets.xcassets/feedColor.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "20", - "alpha" : "1.000", - "blue" : "243", - "green" : "140" - } - } - } - ] -} \ No newline at end of file diff --git a/iOS/Resources/Assets.xcassets/netNewsWireBlueColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/netNewsWireBlueColor.colorset/Contents.json new file mode 100644 index 000000000..bfb477048 --- /dev/null +++ b/iOS/Resources/Assets.xcassets/netNewsWireBlueColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x08", + "alpha" : "1.000", + "blue" : "0xEE", + "green" : "0x6A" + } + } + }, + { + "idiom" : "universal", + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "0x44", + "alpha" : "1.000", + "blue" : "0xE2", + "green" : "0x90" + } + } + } + ] +} \ No newline at end of file diff --git a/iOS/Resources/Assets.xcassets/selectionBackgroundColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/selectionBackgroundColor.colorset/Contents.json deleted file mode 100644 index 728894ebe..000000000 --- a/iOS/Resources/Assets.xcassets/selectionBackgroundColor.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "111", - "alpha" : "1.000", - "blue" : "250", - "green" : "175" - } - } - } - ] -} \ No newline at end of file diff --git a/iOS/Settings/UIKit/DetailAccountViewController.swift b/iOS/Settings/UIKit/DetailAccountViewController.swift index e44fc0099..43b281ada 100644 --- a/iOS/Settings/UIKit/DetailAccountViewController.swift +++ b/iOS/Settings/UIKit/DetailAccountViewController.swift @@ -59,7 +59,7 @@ extension DetailAccountViewController { } let bgView = UIView() - bgView.backgroundColor = AppAssets.selectionBackgroundColor + bgView.backgroundColor = AppAssets.netNewsWireBlueColor cell.selectedBackgroundView = bgView return cell } diff --git a/iOS/Settings/UIKit/RefreshIntervalViewController.swift b/iOS/Settings/UIKit/RefreshIntervalViewController.swift index 4d933edae..f03c5cd4e 100644 --- a/iOS/Settings/UIKit/RefreshIntervalViewController.swift +++ b/iOS/Settings/UIKit/RefreshIntervalViewController.swift @@ -25,7 +25,7 @@ class RefreshIntervalViewController: UITableViewController { cell.textLabel?.adjustsFontForContentSizeCategory = true let bgView = UIView() - bgView.backgroundColor = AppAssets.selectionBackgroundColor + bgView.backgroundColor = AppAssets.netNewsWireBlueColor cell.selectedBackgroundView = bgView let userRefreshInterval = AppDefaults.refreshInterval diff --git a/iOS/Settings/UIKit/SettingsViewController.swift b/iOS/Settings/UIKit/SettingsViewController.swift index 52c7da5f7..28984738e 100644 --- a/iOS/Settings/UIKit/SettingsViewController.swift +++ b/iOS/Settings/UIKit/SettingsViewController.swift @@ -93,7 +93,7 @@ class SettingsViewController: UITableViewController { } let bgView = UIView() - bgView.backgroundColor = AppAssets.selectionBackgroundColor + bgView.backgroundColor = AppAssets.netNewsWireBlueColor cell.selectedBackgroundView = bgView return cell diff --git a/iOS/Settings/UIKit/TimelineNumberOfLinesViewController.swift b/iOS/Settings/UIKit/TimelineNumberOfLinesViewController.swift index ea0442d8a..e0f72ea69 100644 --- a/iOS/Settings/UIKit/TimelineNumberOfLinesViewController.swift +++ b/iOS/Settings/UIKit/TimelineNumberOfLinesViewController.swift @@ -25,7 +25,7 @@ class TimelineNumberOfLinesViewController: UITableViewController { cell.textLabel?.adjustsFontForContentSizeCategory = true let bgView = UIView() - bgView.backgroundColor = AppAssets.selectionBackgroundColor + bgView.backgroundColor = AppAssets.netNewsWireBlueColor cell.selectedBackgroundView = bgView cell.textLabel?.text = "\(2 + indexPath.row)" + NSLocalizedString(" lines", comment: "Lines")