diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index 352ece4b1..7477f223f 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -60,6 +60,10 @@ struct AppAssets { return UIColor(named: "netNewsWireBlueColor")! }() + static var selectedTextColor: UIColor = { + return UIColor(named: "selectedTextColor")! + }() + static var settingsImage: UIImage = { return UIImage(named: "settingsImage")! }() diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift index 7f34a65cc..5d13b52aa 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift @@ -105,6 +105,12 @@ class MasterFeedTableViewCell : UITableViewCell { commonInit() } + override func setSelected(_ selected: Bool, animated: Bool) { + titleView.textColor = selected ? AppAssets.selectedTextColor : UIColor.label + faviconImageView.tintColor = selected ? AppAssets.selectedTextColor : tintColor + super.setSelected(selected, animated: animated) + } + override func willTransition(to state: UITableViewCell.StateMask) { super.willTransition(to: state) showingEditControl = state.contains(.showingEditControl) diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index adfe89aea..5cf316e5b 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -44,6 +44,17 @@ class MasterTimelineTableViewCell: UITableViewCell { } } + override func setSelected(_ selected: Bool, animated: Bool) { + let selectedTextColor = selected ? AppAssets.selectedTextColor : UIColor.label + titleView.textColor = selectedTextColor + summaryView.textColor = selectedTextColor + dateView.textColor = selectedTextColor + feedNameView.textColor = selectedTextColor + unreadIndicatorView.isSelected = selected + + super.setSelected(selected, animated: animated) + } + override func sizeThatFits(_ size: CGSize) -> CGSize { let layout = updatedLayout(width: size.width) return CGSize(width: size.width, height: layout.height) diff --git a/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift b/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift index d7e90469a..d09cd8f34 100644 --- a/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift +++ b/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift @@ -10,6 +10,12 @@ import UIKit class MasterUnreadIndicatorView: UIView { + var isSelected = false { + didSet { + setNeedsDisplay() + } + } + override init(frame: CGRect) { super.init(frame: frame) self.isOpaque = false @@ -26,7 +32,11 @@ class MasterUnreadIndicatorView: UIView { }() override func draw(_ dirtyRect: CGRect) { - AppAssets.timelineUnreadCircleColor.setFill() + if isSelected { + AppAssets.selectedTextColor.setFill() + } else { + AppAssets.timelineUnreadCircleColor.setFill() + } MasterUnreadIndicatorView.bezierPath.fill() } diff --git a/iOS/Resources/Assets.xcassets/selectedTextColor.colorset/Contents.json b/iOS/Resources/Assets.xcassets/selectedTextColor.colorset/Contents.json new file mode 100644 index 000000000..c6e5d3d43 --- /dev/null +++ b/iOS/Resources/Assets.xcassets/selectedTextColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + }, + "colors" : [ + { + "idiom" : "universal", + "color" : { + "color-space" : "srgb", + "components" : { + "red" : "1.000", + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000" + } + } + } + ] +} \ No newline at end of file