Convert iOS smart feed icons back to symbol images so that they show up as white when selected.

This commit is contained in:
Maurice Parker 2020-12-06 16:01:43 -06:00
parent f4397734b1
commit 5927c77a04
14 changed files with 36 additions and 88 deletions

View File

@ -22,7 +22,9 @@ struct StarredFeedDelegate: SmartFeedDelegate {
let nameForDisplay = NSLocalizedString("Starred", comment: "Starred pseudo-feed title")
let fetchType: FetchType = .starred
var smallIcon: IconImage? = AppAssets.starredFeedImage
var smallIcon: IconImage? {
return AppAssets.starredFeedImage
}
func fetchUnreadCount(for account: Account, completion: @escaping SingleUnreadCountCompletionBlock) {
account.fetchUnreadCountForStarredArticles(completion)

View File

@ -20,7 +20,9 @@ struct TodayFeedDelegate: SmartFeedDelegate {
let nameForDisplay = NSLocalizedString("Today", comment: "Today pseudo-feed title")
let fetchType = FetchType.today
var smallIcon: IconImage? = AppAssets.todayFeedImage
var smallIcon: IconImage? {
return AppAssets.todayFeedImage
}
func fetchUnreadCount(for account: Account, completion: @escaping SingleUnreadCountCompletionBlock) {
account.fetchUnreadCountForToday(completion)

View File

@ -39,7 +39,9 @@ final class UnreadFeed: PseudoFeed {
}
}
var smallIcon: IconImage? = AppAssets.unreadFeedImage
var smallIcon: IconImage? {
return AppAssets.unreadFeedImage
}
#if os(macOS)
var pasteboardWriter: NSPasteboardWriting {

View File

@ -177,9 +177,9 @@ struct AppAssets {
return UIImage(systemName: "arrow.turn.down.left")!
}()
static var primaryAccentColor: UIColor = {
static var primaryAccentColor: UIColor {
return UIColor(named: "primaryAccentColor")!
}()
}
static var safariImage: UIImage = {
return UIImage(systemName: "safari")!
@ -189,9 +189,9 @@ struct AppAssets {
return IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true)
}()
static var secondaryAccentColor: UIColor = {
static var secondaryAccentColor: UIColor {
return UIColor(named: "secondaryAccentColor")!
}()
}
static var sectionHeaderColor: UIColor = {
return UIColor(named: "sectionHeaderColor")!
@ -217,10 +217,10 @@ struct AppAssets {
return UIImage(systemName: "star")!
}()
static var starredFeedImage: IconImage = {
let image = UIImage(named: "smartFeedStar")!
return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: nil)
}()
static var starredFeedImage: IconImage {
let image = UIImage(systemName: "star.fill")!
return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAssets.starColor.cgColor)
}
static var tickMarkColor: UIColor = {
return UIColor(named: "tickMarkColor")!
@ -231,19 +231,19 @@ struct AppAssets {
return image.withTintColor(AppAssets.starColor, renderingMode: .alwaysOriginal)
}()
static var todayFeedImage: IconImage = {
let image = UIImage(named: "smartFeedToday")!
return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: nil)
}()
static var todayFeedImage: IconImage {
let image = UIImage(systemName: "sun.max.fill")!
return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: UIColor.systemOrange.cgColor)
}
static var trashImage: UIImage = {
return UIImage(systemName: "trash")!
}()
static var unreadFeedImage: IconImage = {
let image = UIImage(named: "smartFeedUnread")!
return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: nil)
}()
static var unreadFeedImage: IconImage {
let image = UIImage(systemName: "largecircle.fill.circle")!
return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAssets.secondaryAccentColor.cgColor)
}
static var vibrantTextColor: UIColor = {
return UIColor(named: "vibrantTextColor")!

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17503.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17502"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
@ -332,7 +332,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Article Title" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iFp-rn-HhQ">
<rect key="frame" x="20" y="74.5" width="135.5" height="33.5"/>
<rect key="frame" x="20" y="74.5" width="136" height="33.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>

View File

@ -588,7 +588,14 @@ private extension MasterTimelineViewController {
title = coordinator.timelineFeed?.nameForDisplay ?? "Timeline"
if let titleView = navigationItem.titleView as? MasterTimelineTitleView {
titleView.iconView.iconImage = coordinator.timelineIconImage
let timelineIconImage = coordinator.timelineIconImage
titleView.iconView.iconImage = timelineIconImage
if let preferredColor = timelineIconImage?.preferredColor {
titleView.iconView.tintColor = UIColor(cgColor: preferredColor)
} else {
titleView.iconView.tintColor = nil
}
titleView.label.text = coordinator.timelineFeed?.nameForDisplay
updateTitleUnreadCount()

View File

@ -1,15 +0,0 @@
{
"images" : [
{
"filename" : "smartfeed.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}

View File

@ -1,25 +0,0 @@
{
"images" : [
{
"filename" : "today-any.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "today-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}

View File

@ -1,25 +0,0 @@
{
"images" : [
{
"filename" : "unread-any.pdf",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "unread-dark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}