Update timeline to use new semantic colors (darkmode support)
This commit is contained in:
parent
86e1a58b06
commit
ae2c4b9d25
@ -84,14 +84,6 @@ struct AppAssets {
|
|||||||
return image.maskWithColor(color: AppAssets.starColor.cgColor)!
|
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 = {
|
static var timelineUnreadCircleColor: UIColor = {
|
||||||
return UIColor(named: "timelineUnreadCircleColor")!
|
return UIColor(named: "timelineUnreadCircleColor")!
|
||||||
}()
|
}()
|
||||||
|
@ -23,25 +23,21 @@ struct MasterTimelineDefaultCellLayout: MasterTimelineCellLayout {
|
|||||||
static let avatarMarginRight = CGFloat(integerLiteral: 8)
|
static let avatarMarginRight = CGFloat(integerLiteral: 8)
|
||||||
static let avatarCornerRadius = CGFloat(integerLiteral: 4)
|
static let avatarCornerRadius = CGFloat(integerLiteral: 4)
|
||||||
|
|
||||||
static let titleColor = AppAssets.timelineTextPrimaryColor
|
|
||||||
static var titleFont: UIFont {
|
static var titleFont: UIFont {
|
||||||
return UIFont.preferredFont(forTextStyle: .headline)
|
return UIFont.preferredFont(forTextStyle: .headline)
|
||||||
}
|
}
|
||||||
static let titleBottomMargin = CGFloat(integerLiteral: 1)
|
static let titleBottomMargin = CGFloat(integerLiteral: 1)
|
||||||
|
|
||||||
static let feedColor = AppAssets.timelineTextSecondaryColor
|
|
||||||
static var feedNameFont: UIFont {
|
static var feedNameFont: UIFont {
|
||||||
return UIFont.preferredFont(forTextStyle: .footnote)
|
return UIFont.preferredFont(forTextStyle: .footnote)
|
||||||
}
|
}
|
||||||
static let feedRightMargin = CGFloat(integerLiteral: 8)
|
static let feedRightMargin = CGFloat(integerLiteral: 8)
|
||||||
|
|
||||||
static let dateColor = AppAssets.timelineTextSecondaryColor
|
|
||||||
static var dateFont: UIFont {
|
static var dateFont: UIFont {
|
||||||
return UIFont.preferredFont(forTextStyle: .footnote)
|
return UIFont.preferredFont(forTextStyle: .footnote)
|
||||||
}
|
}
|
||||||
static let dateMarginBottom = CGFloat(integerLiteral: 1)
|
static let dateMarginBottom = CGFloat(integerLiteral: 1)
|
||||||
|
|
||||||
static let summaryColor = AppAssets.timelineTextPrimaryColor
|
|
||||||
static var summaryFont: UIFont {
|
static var summaryFont: UIFont {
|
||||||
return UIFont.preferredFont(forTextStyle: .body)
|
return UIFont.preferredFont(forTextStyle: .body)
|
||||||
}
|
}
|
||||||
|
@ -141,19 +141,19 @@ private extension MasterTimelineTableViewCell {
|
|||||||
|
|
||||||
func updateTitleView() {
|
func updateTitleView() {
|
||||||
titleView.font = MasterTimelineDefaultCellLayout.titleFont
|
titleView.font = MasterTimelineDefaultCellLayout.titleFont
|
||||||
titleView.textColor = MasterTimelineDefaultCellLayout.titleColor
|
titleView.textColor = .label
|
||||||
updateTextFieldText(titleView, cellData?.title)
|
updateTextFieldText(titleView, cellData?.title)
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateSummaryView() {
|
func updateSummaryView() {
|
||||||
summaryView.font = MasterTimelineDefaultCellLayout.summaryFont
|
summaryView.font = MasterTimelineDefaultCellLayout.summaryFont
|
||||||
summaryView.textColor = MasterTimelineDefaultCellLayout.summaryColor
|
summaryView.textColor = .label
|
||||||
updateTextFieldText(summaryView, cellData?.summary)
|
updateTextFieldText(summaryView, cellData?.summary)
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateDateView() {
|
func updateDateView() {
|
||||||
dateView.font = MasterTimelineDefaultCellLayout.dateFont
|
dateView.font = MasterTimelineDefaultCellLayout.dateFont
|
||||||
dateView.textColor = MasterTimelineDefaultCellLayout.dateColor
|
dateView.textColor = .secondaryLabel
|
||||||
updateTextFieldText(dateView, cellData.dateString)
|
updateTextFieldText(dateView, cellData.dateString)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ private extension MasterTimelineTableViewCell {
|
|||||||
if cellData.showFeedName {
|
if cellData.showFeedName {
|
||||||
showView(feedNameView)
|
showView(feedNameView)
|
||||||
feedNameView.font = MasterTimelineDefaultCellLayout.feedNameFont
|
feedNameView.font = MasterTimelineDefaultCellLayout.feedNameFont
|
||||||
feedNameView.textColor = MasterTimelineDefaultCellLayout.feedColor
|
feedNameView.textColor = .secondaryLabel
|
||||||
updateTextFieldText(feedNameView, cellData.feedName)
|
updateTextFieldText(feedNameView, cellData.feedName)
|
||||||
} else {
|
} else {
|
||||||
hideView(feedNameView)
|
hideView(feedNameView)
|
||||||
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user