Use colorful smart feed icons on iOS

This commit is contained in:
Maurice Parker 2020-08-11 20:41:20 -05:00
parent f8cf5676e9
commit d05b450cc5
2 changed files with 19 additions and 4 deletions

View File

@ -206,7 +206,8 @@ struct AppAssets {
}()
static var starredFeedImage: IconImage = {
return IconImage(UIImage(systemName: "star.fill")!)
let image = UIImage(systemName: "star.fill")!
return IconImage(image, isSymbol: true, preferredColor: AppAssets.starColor.cgColor)
}()
static var tickMarkColor: UIColor = {
@ -219,7 +220,8 @@ struct AppAssets {
}()
static var todayFeedImage: IconImage = {
return IconImage(UIImage(systemName: "sun.max.fill")!)
let image = UIImage(systemName: "sun.max.fill")!
return IconImage(image, isSymbol: true, preferredColor: UIColor.systemOrange.cgColor)
}()
static var trashImage: UIImage = {
@ -227,7 +229,8 @@ struct AppAssets {
}()
static var unreadFeedImage: IconImage = {
return IconImage(UIImage(systemName: "largecircle.fill.circle")!)
let image = UIImage(systemName: "largecircle.fill.circle")!
return IconImage(image, isSymbol: true, preferredColor: AppAssets.secondaryAccentColor.cgColor)
}()
static var vibrantTextColor: UIColor = {

View File

@ -155,10 +155,22 @@ class MasterFeedTableViewCell : VibrantTableViewCell {
override func updateVibrancy(animated: Bool) {
super.updateVibrancy(animated: animated)
let iconTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor
let iconTintColor: UIColor
if isHighlighted || isSelected {
iconTintColor = AppAssets.vibrantTextColor
} else {
if let preferredColor = iconImage?.preferredColor {
iconTintColor = UIColor(cgColor: preferredColor)
} else {
iconTintColor = AppAssets.secondaryAccentColor
}
}
UIView.animate(withDuration: duration(animated: animated)) {
self.iconView.tintColor = iconTintColor
}
updateLabelVibrancy(titleView, color: labelColor, animated: animated)
}