Update timeline theme. Issue #1169

This commit is contained in:
Maurice Parker 2019-10-25 15:52:32 -05:00
parent cf7ea99cb6
commit 21aaf71cbf
5 changed files with 53 additions and 3 deletions

View File

@ -157,6 +157,10 @@ struct AppAssets {
return UIImage(systemName: "star.fill")!
}()
static var timelineBackgroundColor: UIColor = {
return UIColor(named: "timelineBackgroundColor")!
}()
static var timelineStarImage: UIImage = {
let image = UIImage(systemName: "star.fill")!
return image.withTintColor(AppAssets.starColor, renderingMode: .alwaysOriginal)

View File

@ -35,7 +35,7 @@ struct MasterTimelineAccessibilityCellLayout: MasterTimelineCellLayout {
currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight
// Separator Insets
self.separatorInsets = UIEdgeInsets(top: 0, left: currentPoint.x, bottom: 0, right: 0)
self.separatorInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
// Avatar
if cellData.showAvatar {

View File

@ -68,7 +68,7 @@ struct MasterTimelineDefaultCellLayout: MasterTimelineCellLayout {
currentPoint.x += MasterTimelineDefaultCellLayout.unreadCircleDimension + MasterTimelineDefaultCellLayout.unreadCircleMarginRight
// Separator Insets
self.separatorInsets = UIEdgeInsets(top: 0, left: currentPoint.x, bottom: 0, right: 0)
self.separatorInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
// Avatar
if cellData.showAvatar {

View File

@ -23,6 +23,12 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
return NonIntrinsicImageView(image: AppAssets.timelineStarImage)
}()
private let separatorAccent: UIView = {
let view = UIView()
view.backgroundColor = UIColor.white
return view
}()
var cellData: MasterTimelineCellData! {
didSet {
updateSubviews()
@ -43,6 +49,8 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
summaryView.highlightedTextColor = highlightedTextColor
dateView.highlightedTextColor = highlightedTextColor
feedNameView.highlightedTextColor = highlightedTextColor
backgroundColor = AppAssets.timelineBackgroundColor
}
override var frame: CGRect {
@ -82,6 +90,10 @@ class MasterTimelineTableViewCell: VibrantTableViewCell {
separatorInset = layout.separatorInsets
if traitCollection.userInterfaceStyle == .light {
let separatorAccentRect = CGRect(x: safeAreaInsets.left, y: frame.height - 2, width: frame.width - safeAreaInsets.right - safeAreaInsets.left, height: 1)
separatorAccent.setFrameIfNotEqual(separatorAccentRect)
}
}
func setAvatarImage(_ image: UIImage) {
@ -137,7 +149,8 @@ private extension MasterTimelineTableViewCell {
addSubviewAtInit(feedNameView, hidden: true)
addSubviewAtInit(avatarView, hidden: true)
addSubviewAtInit(starView, hidden: true)
addSubviewAtInit(separatorAccent, hidden: false)
}
func updatedLayout(width: CGFloat) -> MasterTimelineCellLayout {

View File

@ -0,0 +1,33 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : "247",
"alpha" : "1.000",
"blue" : "247",
"green" : "247"
}
}
},
{
"idiom" : "universal",
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"platform" : "ios",
"reference" : "systemBackgroundColor"
}
}
]
}