Implement different icons for each individual smartfeed
This commit is contained in:
parent
73b7436c62
commit
372fb06716
@ -49,4 +49,21 @@ struct AppAssets {
|
||||
static var avatarDarkBackgroundColor: NSColor = {
|
||||
return NSColor(named: NSColor.Name("avatarDarkBackgroundColor"))!
|
||||
}()
|
||||
|
||||
static var searchFeedImage: RSImage = {
|
||||
return RSImage(named: NSImage.smartBadgeTemplateName)!
|
||||
}()
|
||||
|
||||
static var starredFeedImage: RSImage = {
|
||||
return RSImage(named: NSImage.smartBadgeTemplateName)!
|
||||
}()
|
||||
|
||||
static var todayFeedImage: RSImage = {
|
||||
return RSImage(named: NSImage.smartBadgeTemplateName)!
|
||||
}()
|
||||
|
||||
static var unreadFeedImage: RSImage = {
|
||||
return RSImage(named: NSImage.smartBadgeTemplateName)!
|
||||
}()
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RSCore
|
||||
import Account
|
||||
import Articles
|
||||
|
||||
@ -19,6 +20,7 @@ struct SearchFeedDelegate: SmartFeedDelegate {
|
||||
let nameForDisplayPrefix = NSLocalizedString("Search: ", comment: "Search smart feed title prefix")
|
||||
let searchString: String
|
||||
let fetchType: FetchType
|
||||
var smallIcon: RSImage? = AppAssets.searchFeedImage
|
||||
|
||||
init(searchString: String) {
|
||||
self.searchString = searchString
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RSCore
|
||||
import Account
|
||||
import Articles
|
||||
|
||||
@ -19,6 +20,7 @@ struct SearchTimelineFeedDelegate: SmartFeedDelegate {
|
||||
let nameForDisplayPrefix = NSLocalizedString("Search: ", comment: "Search smart feed title prefix")
|
||||
let searchString: String
|
||||
let fetchType: FetchType
|
||||
var smallIcon: RSImage? = AppAssets.searchFeedImage
|
||||
|
||||
init(searchString: String, articleIDs: Set<String>) {
|
||||
self.searchString = searchString
|
||||
|
@ -25,6 +25,10 @@ final class SmartFeed: PseudoFeed {
|
||||
}
|
||||
}
|
||||
|
||||
var smallIcon: RSImage? {
|
||||
return delegate.smallIcon
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
var pasteboardWriter: NSPasteboardWriting {
|
||||
return SmartFeedPasteboardWriter(smartFeed: self)
|
||||
|
@ -11,7 +11,7 @@ import Account
|
||||
import Articles
|
||||
import RSCore
|
||||
|
||||
protocol SmartFeedDelegate: DisplayNameProvider, ArticleFetcher {
|
||||
protocol SmartFeedDelegate: DisplayNameProvider, ArticleFetcher, SmallIconProvider {
|
||||
|
||||
var fetchType: FetchType { get }
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RSCore
|
||||
import Articles
|
||||
import Account
|
||||
|
||||
@ -16,6 +17,7 @@ struct StarredFeedDelegate: SmartFeedDelegate {
|
||||
|
||||
let nameForDisplay = NSLocalizedString("Starred", comment: "Starred pseudo-feed title")
|
||||
let fetchType: FetchType = .starred
|
||||
var smallIcon: RSImage? = AppAssets.starredFeedImage
|
||||
|
||||
func fetchUnreadCount(for account: Account, callback: @escaping (Int) -> Void) {
|
||||
account.fetchUnreadCountForStarredArticles(callback)
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RSCore
|
||||
import Articles
|
||||
import Account
|
||||
|
||||
@ -14,7 +15,8 @@ struct TodayFeedDelegate: SmartFeedDelegate {
|
||||
|
||||
let nameForDisplay = NSLocalizedString("Today", comment: "Today pseudo-feed title")
|
||||
let fetchType = FetchType.today
|
||||
|
||||
var smallIcon: RSImage? = AppAssets.todayFeedImage
|
||||
|
||||
func fetchUnreadCount(for account: Account, callback: @escaping (Int) -> Void) {
|
||||
account.fetchUnreadCountForToday(callback)
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import AppKit
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
import RSCore
|
||||
import Account
|
||||
import Articles
|
||||
|
||||
@ -29,6 +30,8 @@ final class UnreadFeed: PseudoFeed {
|
||||
}
|
||||
}
|
||||
|
||||
var smallIcon: RSImage? = AppAssets.unreadFeedImage
|
||||
|
||||
#if os(macOS)
|
||||
var pasteboardWriter: NSPasteboardWriting {
|
||||
return SmartFeedPasteboardWriter(smartFeed: self)
|
||||
|
@ -27,7 +27,7 @@ struct AppAssets {
|
||||
}()
|
||||
|
||||
static var circleClosedImage: UIImage = {
|
||||
return UIImage(systemName: "circle.fill")!
|
||||
return UIImage(systemName: "largecircle.fill.circle")!
|
||||
}()
|
||||
|
||||
static var circleOpenImage: UIImage = {
|
||||
@ -60,10 +60,6 @@ struct AppAssets {
|
||||
return RSImage(named: "faviconTemplateImage")!
|
||||
}()
|
||||
|
||||
static var feedImage: RSImage = {
|
||||
return RSImage(named: "feedImage")!
|
||||
}()
|
||||
|
||||
static var markAllInFeedAsReadImage: UIImage = {
|
||||
return UIImage(systemName: "asterisk.circle")!
|
||||
}()
|
||||
@ -96,8 +92,8 @@ struct AppAssets {
|
||||
return UIImage(systemName: "safari")!
|
||||
}()
|
||||
|
||||
static var settingsImage: UIImage = {
|
||||
return UIImage(named: "settingsImage")!
|
||||
static var searchFeedImage: UIImage = {
|
||||
return UIImage(named: "magnifyingglass")!
|
||||
}()
|
||||
|
||||
static var shareImage: UIImage = {
|
||||
@ -120,6 +116,10 @@ struct AppAssets {
|
||||
return UIImage(systemName: "star")!
|
||||
}()
|
||||
|
||||
static var starredFeedImage: UIImage = {
|
||||
return UIImage(systemName: "star.fill")!
|
||||
}()
|
||||
|
||||
static var tableViewCellHighlightedTextColor: UIColor = {
|
||||
return UIColor(named: "tableViewCellHighlightedTextColor")!
|
||||
}()
|
||||
@ -141,8 +141,16 @@ struct AppAssets {
|
||||
return UIColor(named: "timelineUnreadCircleColor")!
|
||||
}()
|
||||
|
||||
static var todayFeedImage: UIImage = {
|
||||
return UIImage(systemName: "sun.max.fill")!
|
||||
}()
|
||||
|
||||
static var trashImage: UIImage = {
|
||||
return UIImage(systemName: "trash")!
|
||||
}()
|
||||
|
||||
static var unreadFeedImage: UIImage = {
|
||||
return UIImage(systemName: "largecircle.fill.circle")!
|
||||
}()
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14865.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Cqo-6I-B1A">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Cqo-6I-B1A">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14819.2"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@ -70,7 +70,7 @@
|
||||
<barButtonItem systemItem="add" id="PVr-3K-nPg"/>
|
||||
</toolbarItems>
|
||||
<navigationItem key="navigationItem" title="Feeds" largeTitleDisplayMode="never" id="lE1-xw-gjH">
|
||||
<barButtonItem key="leftBarButtonItem" title="Item" image="settingsImage" id="AK3-N5-4ke"/>
|
||||
<barButtonItem key="leftBarButtonItem" title="Item" image="gear" catalog="system" id="AK3-N5-4ke"/>
|
||||
<barButtonItem key="rightBarButtonItem" title="Edit" id="Khk-Hd-iNS"/>
|
||||
</navigationItem>
|
||||
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
|
||||
@ -114,6 +114,6 @@
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="settingsImage" width="24" height="24"/>
|
||||
<image name="gear" catalog="system" width="64" height="60"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14865.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Cqo-6I-B1A">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Cqo-6I-B1A">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14819.2"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@ -70,7 +70,7 @@
|
||||
<barButtonItem systemItem="add" id="PVr-3K-nPg"/>
|
||||
</toolbarItems>
|
||||
<navigationItem key="navigationItem" title="Feeds" largeTitleDisplayMode="always" id="lE1-xw-gjH">
|
||||
<barButtonItem key="leftBarButtonItem" title="Item" image="settingsImage" id="AK3-N5-4ke"/>
|
||||
<barButtonItem key="leftBarButtonItem" title="Item" image="gear" catalog="system" id="AK3-N5-4ke"/>
|
||||
<barButtonItem key="rightBarButtonItem" title="Edit" id="Khk-Hd-iNS"/>
|
||||
</navigationItem>
|
||||
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
|
||||
@ -114,6 +114,6 @@
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="settingsImage" width="24" height="24"/>
|
||||
<image name="gear" catalog="system" width="64" height="60"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14865.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="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14819.2"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@ -235,7 +235,7 @@
|
||||
</barButtonItem>
|
||||
</toolbarItems>
|
||||
<navigationItem key="navigationItem" title="Feeds" id="Zdf-7t-Un8">
|
||||
<barButtonItem key="leftBarButtonItem" image="settingsImage" id="TlU-Pg-ATe">
|
||||
<barButtonItem key="leftBarButtonItem" title="Item" image="gear" catalog="system" id="TlU-Pg-ATe">
|
||||
<connections>
|
||||
<action selector="settings:" destination="7bK-jq-Zjz" id="Y8a-lz-Im7"/>
|
||||
</connections>
|
||||
@ -258,8 +258,8 @@
|
||||
<image name="arrow.down.circle" catalog="system" width="64" height="62"/>
|
||||
<image name="arrow.up" catalog="system" width="58" height="64"/>
|
||||
<image name="circle" catalog="system" width="64" height="62"/>
|
||||
<image name="gear" catalog="system" width="64" height="60"/>
|
||||
<image name="safari" catalog="system" width="64" height="62"/>
|
||||
<image name="settingsImage" width="24" height="24"/>
|
||||
<image name="square.and.arrow.up" catalog="system" width="56" height="64"/>
|
||||
<image name="star" catalog="system" width="64" height="58"/>
|
||||
</resources>
|
||||
|
@ -93,7 +93,7 @@ class MasterFeedTableViewCell : NNWTableViewCell {
|
||||
}()
|
||||
|
||||
private let faviconImageView: UIImageView = {
|
||||
return NonIntrinsicImageView(image: AppAssets.feedImage)
|
||||
return NonIntrinsicImageView(image: AppAssets.faviconTemplateImage)
|
||||
}()
|
||||
|
||||
private var unreadCountView = MasterFeedUnreadCountView(frame: CGRect.zero)
|
||||
|
@ -21,7 +21,7 @@ final class MasterTimelineAvatarView: UIView {
|
||||
}
|
||||
|
||||
private let imageView: UIImageView = {
|
||||
let imageView = NonIntrinsicImageView(image: AppAssets.feedImage)
|
||||
let imageView = NonIntrinsicImageView(image: AppAssets.faviconTemplateImage)
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
return imageView
|
||||
}()
|
||||
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "safari.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"preserves-vector-representation" : true
|
||||
}
|
||||
}
|
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "globe.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "rss.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
Binary file not shown.
@ -1,15 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "settings3.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"preserves-vector-representation" : true
|
||||
}
|
||||
}
|
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "smartFeed.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user