Change selected table row text to be white. Issue #693

This commit is contained in:
Maurice Parker 2019-08-03 16:25:35 -05:00
parent 4ece4173ba
commit 02575c31fe
5 changed files with 52 additions and 1 deletions

View File

@ -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")!
}()

View File

@ -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)

View File

@ -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)

View File

@ -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()
}

View File

@ -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"
}
}
}
]
}