2019-04-15 22:03:05 +02:00
|
|
|
//
|
|
|
|
// MasterUnreadIndicatorView.swift
|
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 2/16/16.
|
|
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
class MasterUnreadIndicatorView: UIView {
|
|
|
|
|
2019-08-03 23:25:35 +02:00
|
|
|
var isSelected = false {
|
|
|
|
didSet {
|
|
|
|
setNeedsDisplay()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-15 22:03:05 +02:00
|
|
|
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 = {
|
2019-04-30 00:19:08 +02:00
|
|
|
let r = CGRect(x: 0.0, y: 0.0, width: MasterTimelineDefaultCellLayout.unreadCircleDimension, height: MasterTimelineDefaultCellLayout.unreadCircleDimension)
|
2019-04-15 22:03:05 +02:00
|
|
|
return UIBezierPath(ovalIn: r)
|
|
|
|
}()
|
|
|
|
|
|
|
|
override func draw(_ dirtyRect: CGRect) {
|
2019-10-22 10:31:25 +02:00
|
|
|
let color = isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor
|
2019-09-03 07:39:01 +02:00
|
|
|
color.setFill()
|
2019-04-15 22:03:05 +02:00
|
|
|
MasterUnreadIndicatorView.bezierPath.fill()
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|