diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index 63fc84e1b..cbfc85061 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -47,7 +47,11 @@ class MasterTimelineTableViewCell: VibrantTableViewCell { updateLabelVibrancy(feedNameView, animated: animated) UIView.animate(withDuration: duration(animated: animated)) { - self.unreadIndicatorView.isSelected = self.isHighlighted || self.isSelected + if self.isHighlighted || self.isSelected { + self.unreadIndicatorView.backgroundColor = AppAssets.vibrantTextColor + } else { + self.unreadIndicatorView.backgroundColor = AppAssets.secondaryAccentColor + } } } diff --git a/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift b/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift index 88cb190f0..32205f0f9 100644 --- a/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift +++ b/iOS/MasterTimeline/Cell/MasterUnreadIndicatorView.swift @@ -10,31 +10,10 @@ import UIKit class MasterUnreadIndicatorView: UIView { - var isSelected = false { - didSet { - setNeedsDisplay() - } + override func layoutSubviews() { + super.layoutSubviews() + layer.cornerRadius = frame.size.width / 2.0 + clipsToBounds = true } - - override init(frame: CGRect) { - super.init(frame: frame) - self.isOpaque = false - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - self.isOpaque = false - } - - static let bezierPath: UIBezierPath = { - let r = CGRect(x: 0.0, y: 0.0, width: MasterTimelineDefaultCellLayout.unreadCircleDimension, height: MasterTimelineDefaultCellLayout.unreadCircleDimension) - return UIBezierPath(ovalIn: r) - }() - - override func draw(_ dirtyRect: CGRect) { - let color = isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor - color.setFill() - MasterUnreadIndicatorView.bezierPath.fill() - } }