From ae2c4b9d25d00b2bec8f12a88660e56b13f027c5 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 18 Jun 2019 17:47:13 -0500 Subject: [PATCH] Update timeline to use new semantic colors (darkmode support) --- iOS/AppAssets.swift | 8 -------- .../MasterTimelineDefaultCellLayout.swift | 4 ---- .../Cell/MasterTimelineTableViewCell.swift | 8 ++++---- .../Contents.json | 20 ------------------- .../Contents.json | 20 ------------------- 5 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 iOS/Resources/Assets.xcassets/timelineTextPrimaryColor.colorset/Contents.json delete mode 100644 iOS/Resources/Assets.xcassets/timelineTextSecondaryColor.colorset/Contents.json diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index 02c3836b4..9e7ee9c60 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -84,14 +84,6 @@ struct AppAssets { return image.maskWithColor(color: AppAssets.starColor.cgColor)! }() - static var timelineTextPrimaryColor: UIColor = { - return UIColor(named: "timelineTextPrimaryColor")! - }() - - static var timelineTextSecondaryColor: UIColor = { - return UIColor(named: "timelineTextSecondaryColor")! - }() - static var timelineUnreadCircleColor: UIColor = { return UIColor(named: "timelineUnreadCircleColor")! }() diff --git a/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift b/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift index 323278956..e43802c3e 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineDefaultCellLayout.swift @@ -23,25 +23,21 @@ struct MasterTimelineDefaultCellLayout: MasterTimelineCellLayout { static let avatarMarginRight = CGFloat(integerLiteral: 8) static let avatarCornerRadius = CGFloat(integerLiteral: 4) - static let titleColor = AppAssets.timelineTextPrimaryColor static var titleFont: UIFont { return UIFont.preferredFont(forTextStyle: .headline) } static let titleBottomMargin = CGFloat(integerLiteral: 1) - static let feedColor = AppAssets.timelineTextSecondaryColor static var feedNameFont: UIFont { return UIFont.preferredFont(forTextStyle: .footnote) } static let feedRightMargin = CGFloat(integerLiteral: 8) - static let dateColor = AppAssets.timelineTextSecondaryColor static var dateFont: UIFont { return UIFont.preferredFont(forTextStyle: .footnote) } static let dateMarginBottom = CGFloat(integerLiteral: 1) - static let summaryColor = AppAssets.timelineTextPrimaryColor static var summaryFont: UIFont { return UIFont.preferredFont(forTextStyle: .body) } diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index a58034611..58b55beda 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -141,19 +141,19 @@ private extension MasterTimelineTableViewCell { func updateTitleView() { titleView.font = MasterTimelineDefaultCellLayout.titleFont - titleView.textColor = MasterTimelineDefaultCellLayout.titleColor + titleView.textColor = .label updateTextFieldText(titleView, cellData?.title) } func updateSummaryView() { summaryView.font = MasterTimelineDefaultCellLayout.summaryFont - summaryView.textColor = MasterTimelineDefaultCellLayout.summaryColor + summaryView.textColor = .label updateTextFieldText(summaryView, cellData?.summary) } func updateDateView() { dateView.font = MasterTimelineDefaultCellLayout.dateFont - dateView.textColor = MasterTimelineDefaultCellLayout.dateColor + dateView.textColor = .secondaryLabel updateTextFieldText(dateView, cellData.dateString) } @@ -170,7 +170,7 @@ private extension MasterTimelineTableViewCell { if cellData.showFeedName { showView(feedNameView) feedNameView.font = MasterTimelineDefaultCellLayout.feedNameFont - feedNameView.textColor = MasterTimelineDefaultCellLayout.feedColor + feedNameView.textColor = .secondaryLabel updateTextFieldText(feedNameView, cellData.feedName) } else { hideView(feedNameView) diff --git a/iOS/Resources/Assets.xcassets/timelineTextPrimaryColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/timelineTextPrimaryColor.colorset/Contents.json deleted file mode 100644 index ee1c5bc2a..000000000 --- a/iOS/Resources/Assets.xcassets/timelineTextPrimaryColor.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "0x22", - "alpha" : "1.000", - "blue" : "0x22", - "green" : "0x22" - } - } - } - ] -} \ No newline at end of file diff --git a/iOS/Resources/Assets.xcassets/timelineTextSecondaryColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/timelineTextSecondaryColor.colorset/Contents.json deleted file mode 100644 index fc67a140c..000000000 --- a/iOS/Resources/Assets.xcassets/timelineTextSecondaryColor.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "0x80", - "alpha" : "1.000", - "blue" : "0x80", - "green" : "0x80" - } - } - } - ] -} \ No newline at end of file