diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 83bcc2cb4..17036c53d 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -354,6 +354,7 @@ 845122742B8CEA9100480DB0 /* SidebarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8451226E2B8CEA9100480DB0 /* SidebarItem.swift */; }; 845382042CD33B0400B3FBA3 /* AppAsset-Mac.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845382032CD33B0400B3FBA3 /* AppAsset-Mac.swift */; }; 845382062CD33B6200B3FBA3 /* AppAsset-iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845382052CD33B6200B3FBA3 /* AppAsset-iOS.swift */; }; + 845382072CD33F3200B3FBA3 /* AppAsset-iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845382052CD33B6200B3FBA3 /* AppAsset-iOS.swift */; }; 845479881FEB77C000AD8B59 /* TimelineKeyboardShortcuts.plist in Resources */ = {isa = PBXBuildFile; fileRef = 845479871FEB77C000AD8B59 /* TimelineKeyboardShortcuts.plist */; }; 8454C3F3263F2D8700E3F9C7 /* IconImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454C3F2263F2D8700E3F9C7 /* IconImageCache.swift */; }; 8454C3F8263F3AD400E3F9C7 /* IconImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8454C3F2263F2D8700E3F9C7 /* IconImageCache.swift */; }; @@ -3048,6 +3049,7 @@ 51A9A5E82380CA130033AADF /* ShareFolderPickerCell.swift in Sources */, 51A9A5ED2380D6000033AADF /* AppAssets.swift in Sources */, 51B5C8C123F3A0DB00032075 /* ExtensionFeedAddRequestFile.swift in Sources */, + 845382072CD33F3200B3FBA3 /* AppAsset-iOS.swift in Sources */, 51A9A5E12380C4FE0033AADF /* AppDefaults.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Shared/AppAsset-iOS.swift b/Shared/AppAsset-iOS.swift index 9632df32b..cb3f09d15 100644 --- a/Shared/AppAsset-iOS.swift +++ b/Shared/AppAsset-iOS.swift @@ -7,18 +7,78 @@ // import Foundation +import UIKit +import Images +import Core extension AppAsset { - static let starClosedImage = UIImage(systemName: "star.fill")! + static let iconBackgroundColor = UIColor(named: "iconBackgroundColor")! - static let searchFeedImage: IconImage = { - IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true) + static let circleClosedImage = UIImage(systemName: "largecircle.fill.circle")! + + static let circleOpenImage = UIImage(systemName: "circle")! + + static let disclosureImage = UIImage(named: "disclosure")! + + static let copyImage = UIImage(systemName: "doc.on.doc")! + + static let deactivateImage = UIImage(systemName: "minus.circle")! + + static let editImage = UIImage(systemName: "square.and.pencil")! + + static let folderOutlinePlus = UIImage(systemName: "folder.badge.plus")! + + static let fullScreenBackgroundColor = UIColor(named: "fullScreenBackgroundColor")! + + static let infoImage = UIImage(systemName: "info.circle")! + + static let markBelowAsReadImage = UIImage(systemName: "arrowtriangle.down.circle")! + + static let markAboveAsReadImage = UIImage(systemName: "arrowtriangle.up.circle")! + + static let folderImageNonIcon = UIImage(systemName: "folder.fill")!.withRenderingMode(.alwaysOriginal).withTintColor(.secondaryLabel) + + static let moreImage = UIImage(systemName: "ellipsis.circle")! + + static let nextArticleImage = UIImage(systemName: "chevron.down")! + + static let nextUnreadArticleImage = UIImage(systemName: "chevron.down.circle")! + + static let plus = UIImage(systemName: "plus")! + + static let prevArticleImage = UIImage(systemName: "chevron.up")! + + static let openInSidebarImage = UIImage(systemName: "arrow.turn.down.left")! + + static let primaryAccentColor = UIColor(named: "primaryAccentColor")! + + static let safariImage = UIImage(systemName: "safari")! + + static let searchFeedImage = IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true) + + static let secondaryAccentColor = UIColor(named: "secondaryAccentColor")! + + static let sectionHeaderColor = UIColor(named: "sectionHeaderColor")! + + static let smartFeedImage = UIImage(systemName: "gear")! + + static let tickMarkColor = UIColor(named: "tickMarkColor")! + + static let timelineStarImage: UIImage = { + let image = UIImage(systemName: "star.fill")! + return image.withTintColor(AppAsset.starColor, renderingMode: .alwaysOriginal) }() + static let trashImage = UIImage(systemName: "trash")! + + static let vibrantTextColor = UIColor(named: "vibrantTextColor")! + + static let controlBackgroundColor = UIColor(named: "controlBackgroundColor")! + static let unreadFeedImage: IconImage = { let image = UIImage(systemName: "largecircle.fill.circle")! - return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAssets.secondaryAccentColor.cgColor) + return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAsset.secondaryAccentColor.cgColor) }() static let todayFeedImage: IconImage = { @@ -33,7 +93,17 @@ extension AppAsset { static let folderIcon: IconImage = { let image = RSImage.systemImage("folder.fill") - let preferredColor = AppAssets.secondaryAccentColor + let preferredColor = AppAsset.secondaryAccentColor return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: preferredColor.cgColor) }() + + static let articleExtractorOffTinted: UIImage = { + let image = UIImage(named: "articleExtractorOff")! + return image.tinted(color: AppAsset.primaryAccentColor)! + }() + + static let articleExtractorOnTinted: UIImage = { + let image = UIImage(named: "articleExtractorOn")! + return image.tinted(color: AppAsset.primaryAccentColor)! + }() } diff --git a/Shared/AppAsset.swift b/Shared/AppAsset.swift index d206f5bea..8f21f1692 100644 --- a/Shared/AppAsset.swift +++ b/Shared/AppAsset.swift @@ -23,7 +23,6 @@ import Images static let shareImage = RSImage.systemImage("square.and.arrow.up") static let starColor = RSColor(named: "starColor")! - static let starOpenImage = RSImage.systemImage("star") static let starClosedImage = RSImage.systemImage("star.fill") diff --git a/iOS/Account/FeedbinAccountViewController.swift b/iOS/Account/FeedbinAccountViewController.swift index 261c5c217..4ffbb8129 100644 --- a/iOS/Account/FeedbinAccountViewController.swift +++ b/iOS/Account/FeedbinAccountViewController.swift @@ -23,7 +23,7 @@ class FeedbinAccountViewController: UITableViewController { @IBOutlet weak var footerLabel: UILabel! @IBOutlet weak var onepasswordButton: UIBarButtonItem! { didSet { - onepasswordButton.image?.withTintColor(AppAssets.primaryAccentColor) + onepasswordButton.image?.withTintColor(AppAsset.primaryAccentColor) } } diff --git a/iOS/Account/NewsBlurAccountViewController.swift b/iOS/Account/NewsBlurAccountViewController.swift index 03bb43353..2f7666ef9 100644 --- a/iOS/Account/NewsBlurAccountViewController.swift +++ b/iOS/Account/NewsBlurAccountViewController.swift @@ -23,7 +23,7 @@ class NewsBlurAccountViewController: UITableViewController { @IBOutlet weak var footerLabel: UILabel! @IBOutlet weak var onepasswordButton: UIBarButtonItem! { didSet { - onepasswordButton.image?.withTintColor(AppAssets.primaryAccentColor) + onepasswordButton.image?.withTintColor(AppAsset.primaryAccentColor) } } diff --git a/iOS/Account/ReaderAPIAccountViewController.swift b/iOS/Account/ReaderAPIAccountViewController.swift index 9fc75f0df..6aa1279c0 100644 --- a/iOS/Account/ReaderAPIAccountViewController.swift +++ b/iOS/Account/ReaderAPIAccountViewController.swift @@ -26,7 +26,7 @@ class ReaderAPIAccountViewController: UITableViewController { @IBOutlet weak var signUpButton: UIButton! @IBOutlet weak var onepasswordButton: UIBarButtonItem! { didSet { - onepasswordButton.image?.withTintColor(AppAssets.primaryAccentColor) + onepasswordButton.image?.withTintColor(AppAsset.primaryAccentColor) } } diff --git a/iOS/Add/AddComboTableViewCell.swift b/iOS/Add/AddComboTableViewCell.swift index 4e7c30155..ab1f5cffe 100644 --- a/iOS/Add/AddComboTableViewCell.swift +++ b/iOS/Add/AddComboTableViewCell.swift @@ -16,7 +16,7 @@ class AddComboTableViewCell: VibrantTableViewCell { override func updateVibrancy(animated: Bool) { super.updateVibrancy(animated: animated) - let iconTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor + let iconTintColor = isHighlighted || isSelected ? AppAsset.vibrantTextColor : AppAsset.secondaryAccentColor if animated { UIView.animate(withDuration: Self.duration) { self.icon.tintColor = iconTintColor diff --git a/iOS/Add/SelectComboTableViewCell.swift b/iOS/Add/SelectComboTableViewCell.swift index d194a871a..a6f7890c1 100644 --- a/iOS/Add/SelectComboTableViewCell.swift +++ b/iOS/Add/SelectComboTableViewCell.swift @@ -16,7 +16,7 @@ class SelectComboTableViewCell: VibrantTableViewCell { override func updateVibrancy(animated: Bool) { super.updateVibrancy(animated: animated) - let iconTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label + let iconTintColor = isHighlighted || isSelected ? AppAsset.vibrantTextColor : UIColor.label if animated { UIView.animate(withDuration: Self.duration) { self.icon.tintColor = iconTintColor diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index 75c13f8e6..3979d8be3 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -13,82 +13,6 @@ import Images struct AppAssets { - @MainActor static let articleExtractorOffTinted: UIImage = { - let image = UIImage(named: "articleExtractorOff")! - return image.tinted(color: AppAssets.primaryAccentColor)! - }() - - @MainActor static let articleExtractorOnTinted: UIImage = { - let image = UIImage(named: "articleExtractorOn")! - return image.tinted(color: AppAssets.primaryAccentColor)! - }() - - static let iconBackgroundColor = UIColor(named: "iconBackgroundColor")! - - static let circleClosedImage = UIImage(systemName: "largecircle.fill.circle")! - - static let circleOpenImage = UIImage(systemName: "circle")! - - static let disclosureImage = UIImage(named: "disclosure")! - - static let copyImage = UIImage(systemName: "doc.on.doc")! - - static let deactivateImage = UIImage(systemName: "minus.circle")! - - static let editImage = UIImage(systemName: "square.and.pencil")! - - static let folderOutlinePlus = UIImage(systemName: "folder.badge.plus")! - - static let fullScreenBackgroundColor = UIColor(named: "fullScreenBackgroundColor")! - - static let infoImage = UIImage(systemName: "info.circle")! - - static let markBelowAsReadImage = UIImage(systemName: "arrowtriangle.down.circle")! - - static let markAboveAsReadImage = UIImage(systemName: "arrowtriangle.up.circle")! - - static let folderImageNonIcon = UIImage(systemName: "folder.fill")!.withRenderingMode(.alwaysOriginal).withTintColor(.secondaryLabel) - - static let moreImage = UIImage(systemName: "ellipsis.circle")! - - static let nextArticleImage = UIImage(systemName: "chevron.down")! - - static let nextUnreadArticleImage = UIImage(systemName: "chevron.down.circle")! - - static let plus = UIImage(systemName: "plus")! - - static let prevArticleImage = UIImage(systemName: "chevron.up")! - - static let openInSidebarImage = UIImage(systemName: "arrow.turn.down.left")! - - static let primaryAccentColor = UIColor(named: "primaryAccentColor")! - - static let safariImage = UIImage(systemName: "safari")! - - @MainActor static let searchFeedImage = IconImage(UIImage(systemName: "magnifyingglass")!, isSymbol: true) - - static let secondaryAccentColor = UIColor(named: "secondaryAccentColor")! - - static let sectionHeaderColor = UIColor(named: "sectionHeaderColor")! - - static let smartFeedImage = UIImage(systemName: "gear")! - - static let starClosedImage = UIImage(systemName: "star.fill")! - - static let starOpenImage = UIImage(systemName: "star")! - static let tickMarkColor = UIColor(named: "tickMarkColor")! - - static let timelineStarImage: UIImage = { - let image = UIImage(systemName: "star.fill")! - return image.withTintColor(AppAsset.starColor, renderingMode: .alwaysOriginal) - }() - - static let trashImage = UIImage(systemName: "trash")! - - - static let vibrantTextColor = UIColor(named: "vibrantTextColor")! - - static let controlBackgroundColor = UIColor(named: "controlBackgroundColor")! } diff --git a/iOS/Article/ArticleExtractorButton.swift b/iOS/Article/ArticleExtractorButton.swift index 63c6cec3f..751e9ec5d 100644 --- a/iOS/Article/ArticleExtractorButton.swift +++ b/iOS/Article/ArticleExtractorButton.swift @@ -72,8 +72,8 @@ enum ArticleExtractorButtonState { } private func addAnimatedSublayer(to hostedLayer: CALayer) { - let image1 = AppAssets.articleExtractorOffTinted.cgImage! - let image2 = AppAssets.articleExtractorOnTinted.cgImage! + let image1 = AppAsset.articleExtractorOffTinted.cgImage! + let image2 = AppAsset.articleExtractorOnTinted.cgImage! let images = [image1, image2, image1] animatedLayer = CALayer() diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index cc23ca0e9..5b6cf2a73 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -212,20 +212,20 @@ final class ArticleViewController: UIViewController { actionBarButtonItem.isEnabled = permalinkPresent if article.status.read { - readBarButtonItem.image = AppAssets.circleOpenImage + readBarButtonItem.image = AppAsset.circleOpenImage readBarButtonItem.isEnabled = article.isAvailableToMarkUnread readBarButtonItem.accLabelText = NSLocalizedString("Mark Article Unread", comment: "Mark Article Unread") } else { - readBarButtonItem.image = AppAssets.circleClosedImage + readBarButtonItem.image = AppAsset.circleClosedImage readBarButtonItem.isEnabled = true readBarButtonItem.accLabelText = NSLocalizedString("Selected - Mark Article Unread", comment: "Selected - Mark Article Unread") } if article.status.starred { - starBarButtonItem.image = AppAssets.starClosedImage + starBarButtonItem.image = AppAsset.starClosedImage starBarButtonItem.accLabelText = NSLocalizedString("Selected - Star Article", comment: "Selected - Star Article") } else { - starBarButtonItem.image = AppAssets.starOpenImage + starBarButtonItem.image = AppAsset.starOpenImage starBarButtonItem.accLabelText = NSLocalizedString("Star Article", comment: "Star Article") } } diff --git a/iOS/Article/ImageTransition.swift b/iOS/Article/ImageTransition.swift index 25951b301..9d2cc7067 100644 --- a/iOS/Article/ImageTransition.swift +++ b/iOS/Article/ImageTransition.swift @@ -41,7 +41,7 @@ class ImageTransition: NSObject, UIViewControllerAnimatedTransitioning { let fromView = transitionContext.view(forKey: .from)! fromView.removeFromSuperview() - transitionContext.containerView.backgroundColor = AppAssets.fullScreenBackgroundColor + transitionContext.containerView.backgroundColor = AppAsset.fullScreenBackgroundColor transitionContext.containerView.addSubview(imageView) webViewController?.hideClickedImage() diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 4b45d9145..ba96715cb 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -817,7 +817,7 @@ private extension WebViewController { func prevArticleAction() -> UIAction? { guard coordinator.isPrevArticleAvailable else { return nil } let title = NSLocalizedString("Previous Article", comment: "Previous Article") - return UIAction(title: title, image: AppAssets.prevArticleImage) { [weak self] action in + return UIAction(title: title, image: AppAsset.prevArticleImage) { [weak self] action in self?.coordinator.selectPrevArticle() } } @@ -825,7 +825,7 @@ private extension WebViewController { func nextArticleAction() -> UIAction? { guard coordinator.isNextArticleAvailable else { return nil } let title = NSLocalizedString("Next Article", comment: "Next Article") - return UIAction(title: title, image: AppAssets.nextArticleImage) { [weak self] action in + return UIAction(title: title, image: AppAsset.nextArticleImage) { [weak self] action in self?.coordinator.selectNextArticle() } } @@ -834,7 +834,7 @@ private extension WebViewController { guard let article = article, !article.status.read || article.isAvailableToMarkUnread else { return nil } let title = article.status.read ? NSLocalizedString("Mark as Unread", comment: "Mark as Unread") : NSLocalizedString("Mark as Read", comment: "Mark as Read") - let readImage = article.status.read ? AppAssets.circleClosedImage : AppAssets.circleOpenImage + let readImage = article.status.read ? AppAsset.circleClosedImage : AppAsset.circleOpenImage return UIAction(title: title, image: readImage) { [weak self] action in self?.coordinator.toggleReadForCurrentArticle() } @@ -843,7 +843,7 @@ private extension WebViewController { func toggleStarredAction() -> UIAction { let starred = article?.status.starred ?? false let title = starred ? NSLocalizedString("Mark as Unstarred", comment: "Mark as Unstarred") : NSLocalizedString("Mark as Starred", comment: "Mark as Starred") - let starredImage = starred ? AppAssets.starOpenImage : AppAssets.starClosedImage + let starredImage = starred ? AppAsset.starOpenImage : AppAsset.starClosedImage return UIAction(title: title, image: starredImage) { [weak self] action in self?.coordinator.toggleStarredForCurrentArticle() } @@ -852,7 +852,7 @@ private extension WebViewController { func nextUnreadArticleAction() -> UIAction? { guard coordinator.isAnyUnreadAvailable else { return nil } let title = NSLocalizedString("Next Unread Article", comment: "Next Unread Article") - return UIAction(title: title, image: AppAssets.nextUnreadArticleImage) { [weak self] action in + return UIAction(title: title, image: AppAsset.nextUnreadArticleImage) { [weak self] action in self?.coordinator.selectNextUnread() } } diff --git a/iOS/Feeds/Cell/FeedTableViewCell.swift b/iOS/Feeds/Cell/FeedTableViewCell.swift index f539a9c95..b9b2cbe8f 100644 --- a/iOS/Feeds/Cell/FeedTableViewCell.swift +++ b/iOS/Feeds/Cell/FeedTableViewCell.swift @@ -161,12 +161,12 @@ class FeedTableViewCell : VibrantTableViewCell { let iconTintColor: UIColor if isHighlighted || isSelected { - iconTintColor = AppAssets.vibrantTextColor + iconTintColor = AppAsset.vibrantTextColor } else { if let preferredColor = iconImage?.preferredColor { iconTintColor = UIColor(cgColor: preferredColor) } else { - iconTintColor = AppAssets.secondaryAccentColor + iconTintColor = AppAsset.secondaryAccentColor } } @@ -198,8 +198,8 @@ private extension FeedTableViewCell { disclosureButton = NonIntrinsicButton(type: .roundedRect) disclosureButton!.addTarget(self, action: #selector(buttonPressed(_:)), for: UIControl.Event.touchUpInside) - disclosureButton?.setImage(AppAssets.disclosureImage, for: .normal) - disclosureButton?.tintColor = AppAssets.controlBackgroundColor + disclosureButton?.setImage(AppAsset.disclosureImage, for: .normal) + disclosureButton?.tintColor = AppAsset.controlBackgroundColor disclosureButton?.imageView?.contentMode = .center disclosureButton?.imageView?.clipsToBounds = false disclosureButton?.addInteraction(UIPointerInteraction()) diff --git a/iOS/Feeds/Cell/FeedTableViewSectionHeader.swift b/iOS/Feeds/Cell/FeedTableViewSectionHeader.swift index 0beea7691..533a4dae8 100644 --- a/iOS/Feeds/Cell/FeedTableViewSectionHeader.swift +++ b/iOS/Feeds/Cell/FeedTableViewSectionHeader.swift @@ -91,7 +91,7 @@ class FeedTableViewSectionHeader: UITableViewHeaderFooterView { let button = NonIntrinsicButton() button.tintColor = UIColor.tertiaryLabel - button.setImage(AppAssets.disclosureImage, for: .normal) + button.setImage(AppAsset.disclosureImage, for: .normal) button.contentMode = .center button.addInteraction(UIPointerInteraction()) button.addTarget(self, action: #selector(toggleDisclosure), for: .touchUpInside) @@ -206,7 +206,7 @@ private extension FeedTableViewSectionHeader { func addBackgroundView() { self.backgroundView = UIView(frame: self.bounds) - self.backgroundView?.backgroundColor = AppAssets.sectionHeaderColor + self.backgroundView?.backgroundColor = AppAsset.sectionHeaderColor } } diff --git a/iOS/Feeds/Cell/FeedUnreadCountView.swift b/iOS/Feeds/Cell/FeedUnreadCountView.swift index f41213b06..dfbc7c3c9 100644 --- a/iOS/Feeds/Cell/FeedUnreadCountView.swift +++ b/iOS/Feeds/Cell/FeedUnreadCountView.swift @@ -15,7 +15,7 @@ class FeedUnreadCountView : UIView { } let cornerRadius = 8.0 - let bgColor = AppAssets.controlBackgroundColor + let bgColor = AppAsset.controlBackgroundColor var textColor: UIColor { return UIColor.white } diff --git a/iOS/Feeds/SidebarViewController.swift b/iOS/Feeds/SidebarViewController.swift index 4184501af..131fedbd4 100644 --- a/iOS/Feeds/SidebarViewController.swift +++ b/iOS/Feeds/SidebarViewController.swift @@ -597,13 +597,13 @@ class SidebarViewController: UITableViewController, UndoableCommandRunner { var menuItems: [UIAction] = [] let addFeedActionTitle = NSLocalizedString("Add Web Feed", comment: "Add Web Feed") - let addFeedAction = UIAction(title: addFeedActionTitle, image: AppAssets.plus) { _ in + let addFeedAction = UIAction(title: addFeedActionTitle, image: AppAsset.plus) { _ in self.coordinator.showAddFeed() } menuItems.append(addFeedAction) let addFolderActionTitle = NSLocalizedString("Add Folder", comment: "Add Folder") - let addFolderAction = UIAction(title: addFolderActionTitle, image: AppAssets.folderOutlinePlus) { _ in + let addFolderAction = UIAction(title: addFolderActionTitle, image: AppAsset.folderOutlinePlus) { _ in self.coordinator.showAddFolder() } @@ -927,7 +927,7 @@ private extension SidebarViewController { } let title = NSLocalizedString("Open Home Page", comment: "Open Home Page") - let action = UIAction(title: title, image: AppAssets.safariImage) { [weak self] action in + let action = UIAction(title: title, image: AppAsset.safariImage) { [weak self] action in self?.coordinator.showBrowserForFeed(indexPath) } return action @@ -953,7 +953,7 @@ private extension SidebarViewController { } let title = NSLocalizedString("Copy Feed URL", comment: "Copy Feed URL") - let action = UIAction(title: title, image: AppAssets.copyImage) { action in + let action = UIAction(title: title, image: AppAsset.copyImage) { action in UIPasteboard.general.url = url } return action @@ -981,7 +981,7 @@ private extension SidebarViewController { } let title = NSLocalizedString("Copy Home Page URL", comment: "Copy Home Page URL") - let action = UIAction(title: title, image: AppAssets.copyImage) { action in + let action = UIAction(title: title, image: AppAsset.copyImage) { action in UIPasteboard.general.url = url } return action @@ -1037,7 +1037,7 @@ private extension SidebarViewController { func deleteAction(indexPath: IndexPath) -> UIAction { let title = NSLocalizedString("Delete", comment: "Delete") - let action = UIAction(title: title, image: AppAssets.trashImage, attributes: .destructive) { [weak self] action in + let action = UIAction(title: title, image: AppAsset.trashImage, attributes: .destructive) { [weak self] action in self?.delete(indexPath: indexPath) } return action @@ -1045,7 +1045,7 @@ private extension SidebarViewController { func renameAction(indexPath: IndexPath) -> UIAction { let title = NSLocalizedString("Rename", comment: "Rename") - let action = UIAction(title: title, image: AppAssets.editImage) { [weak self] action in + let action = UIAction(title: title, image: AppAsset.editImage) { [weak self] action in self?.rename(indexPath: indexPath) } return action @@ -1057,7 +1057,7 @@ private extension SidebarViewController { } let title = NSLocalizedString("Get Info", comment: "Get Info") - let action = UIAction(title: title, image: AppAssets.infoImage) { [weak self] action in + let action = UIAction(title: title, image: AppAsset.infoImage) { [weak self] action in self?.coordinator.showFeedInspector(for: feed) } return action @@ -1065,7 +1065,7 @@ private extension SidebarViewController { func getAccountInfoAction(account: Account) -> UIAction { let title = NSLocalizedString("Get Info", comment: "Get Info") - let action = UIAction(title: title, image: AppAssets.infoImage) { [weak self] action in + let action = UIAction(title: title, image: AppAsset.infoImage) { [weak self] action in self?.coordinator.showAccountInspector(for: account) } return action @@ -1073,7 +1073,7 @@ private extension SidebarViewController { func deactivateAccountAction(account: Account) -> UIAction { let title = NSLocalizedString("Deactivate", comment: "Deactivate") - let action = UIAction(title: title, image: AppAssets.deactivateImage) { action in + let action = UIAction(title: title, image: AppAsset.deactivateImage) { action in account.isActive = false } return action diff --git a/iOS/IconView.swift b/iOS/IconView.swift index 8c3c7fcd0..9bea3d17c 100644 --- a/iOS/IconView.swift +++ b/iOS/IconView.swift @@ -115,7 +115,7 @@ private extension IconView { private func updateBackgroundColor() { if !isBackgroundSuppressed && ((iconImage != nil && isVerticalBackgroundExposed) || !isDiscernable) { - backgroundColor = AppAssets.iconBackgroundColor + backgroundColor = AppAsset.iconBackgroundColor } else { backgroundColor = nil } diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index fe7f419e5..a51572fd3 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -1416,13 +1416,13 @@ private extension SceneCoordinator { navController.navigationBar.scrollEdgeAppearance = scrollEdge navController.navigationBar.compactScrollEdgeAppearance = scrollEdge - navController.navigationBar.tintColor = AppAssets.primaryAccentColor + navController.navigationBar.tintColor = AppAsset.primaryAccentColor let toolbarAppearance = UIToolbarAppearance() navController.toolbar.standardAppearance = toolbarAppearance navController.toolbar.compactAppearance = toolbarAppearance navController.toolbar.scrollEdgeAppearance = toolbarAppearance - navController.toolbar.tintColor = AppAssets.primaryAccentColor + navController.toolbar.tintColor = AppAsset.primaryAccentColor } func markArticlesWithUndo(_ articles: [Article], statusKey: ArticleStatus.Key, flag: Bool, completion: (() -> Void)? = nil) { diff --git a/iOS/SceneDelegate.swift b/iOS/SceneDelegate.swift index 34df6b496..806325d4d 100644 --- a/iOS/SceneDelegate.swift +++ b/iOS/SceneDelegate.swift @@ -19,7 +19,7 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - window!.tintColor = AppAssets.primaryAccentColor + window!.tintColor = AppAsset.primaryAccentColor updateUserInterfaceStyle() let rootViewController = window!.rootViewController as! RootSplitViewController diff --git a/iOS/Settings/ArticleThemesTableViewController.swift b/iOS/Settings/ArticleThemesTableViewController.swift index b7793d5c4..7374c0b0e 100644 --- a/iOS/Settings/ArticleThemesTableViewController.swift +++ b/iOS/Settings/ArticleThemesTableViewController.swift @@ -100,7 +100,7 @@ class ArticleThemesTableViewController: UITableViewController { self?.present(alertController, animated: true) } - deleteAction.image = AppAssets.trashImage + deleteAction.image = AppAsset.trashImage deleteAction.backgroundColor = UIColor.systemRed return UISwipeActionsConfiguration(actions: [deleteAction]) diff --git a/iOS/Settings/SettingsComboTableViewCell.swift b/iOS/Settings/SettingsComboTableViewCell.swift index 9e0200a27..790ff3f4d 100644 --- a/iOS/Settings/SettingsComboTableViewCell.swift +++ b/iOS/Settings/SettingsComboTableViewCell.swift @@ -17,7 +17,7 @@ class SettingsComboTableViewCell: VibrantTableViewCell { super.updateVibrancy(animated: animated) updateLabelVibrancy(comboNameLabel, color: labelColor, animated: animated) - let tintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label + let tintColor = isHighlighted || isSelected ? AppAsset.vibrantTextColor : UIColor.label if animated { UIView.animate(withDuration: Self.duration) { self.comboImage?.tintColor = tintColor diff --git a/iOS/Settings/TimelineCustomizerViewController.swift b/iOS/Settings/TimelineCustomizerViewController.swift index 113959831..942809c8f 100644 --- a/iOS/Settings/TimelineCustomizerViewController.swift +++ b/iOS/Settings/TimelineCustomizerViewController.swift @@ -30,11 +30,11 @@ final class TimelineCustomizerViewController: UIViewController { iconSizeSliderContainerView.layer.cornerRadius = 10 iconSizeSlider.value = Float(AppDefaults.shared.timelineIconSize.rawValue) - iconSizeSlider.addTickMarks(color: AppAssets.tickMarkColor) + iconSizeSlider.addTickMarks(color: AppAsset.tickMarkColor) numberOfLinesSliderContainerView.layer.cornerRadius = 10 numberOfLinesSlider.value = Float(AppDefaults.shared.timelineNumberOfLines) - numberOfLinesSlider.addTickMarks(color: AppAssets.tickMarkColor) + numberOfLinesSlider.addTickMarks(color: AppAsset.tickMarkColor) } override func viewWillAppear(_ animated: Bool) { diff --git a/iOS/Settings/TimelinePreviewTableViewController.swift b/iOS/Settings/TimelinePreviewTableViewController.swift index 0e5186f28..12a3d1595 100644 --- a/iOS/Settings/TimelinePreviewTableViewController.swift +++ b/iOS/Settings/TimelinePreviewTableViewController.swift @@ -70,7 +70,7 @@ private extension TimelinePreviewTableViewController { let status = ArticleStatus(articleID: prototypeID, read: false, starred: false, dateArrived: Date()) let prototypeArticle = Article(accountID: prototypeID, articleID: prototypeID, feedID: prototypeID, uniqueID: prototypeID, title: longTitle, contentHTML: nil, contentText: nil, url: nil, externalURL: nil, summary: nil, imageURL: nil, datePublished: nil, dateModified: nil, authors: nil, status: status) - let iconImage = IconImage(AppAsset.faviconTemplateImage.withTintColor(AppAssets.secondaryAccentColor)) + let iconImage = IconImage(AppAsset.faviconTemplateImage.withTintColor(AppAsset.secondaryAccentColor)) return TimelineCellData(article: prototypeArticle, showFeedName: .feed, feedName: "Feed Name", byline: nil, iconImage: iconImage, showIcon: true, featuredImage: nil, numberOfLines: AppDefaults.shared.timelineNumberOfLines, iconSize: AppDefaults.shared.timelineIconSize) } diff --git a/iOS/Timeline/Cell/TimelineTableViewCell.swift b/iOS/Timeline/Cell/TimelineTableViewCell.swift index c9608fc06..f895b5111 100644 --- a/iOS/Timeline/Cell/TimelineTableViewCell.swift +++ b/iOS/Timeline/Cell/TimelineTableViewCell.swift @@ -21,7 +21,7 @@ class TimelineTableViewCell: VibrantTableViewCell { private lazy var iconView = IconView() private lazy var starView = { - return NonIntrinsicImageView(image: AppAssets.timelineStarImage) + return NonIntrinsicImageView(image: AppAsset.timelineStarImage) }() private var unreadIndicatorPropertyAnimator: UIViewPropertyAnimator? @@ -63,16 +63,16 @@ class TimelineTableViewCell: VibrantTableViewCell { if animated { UIView.animate(withDuration: Self.duration) { if self.isHighlighted || self.isSelected { - self.unreadIndicatorView.backgroundColor = AppAssets.vibrantTextColor + self.unreadIndicatorView.backgroundColor = AppAsset.vibrantTextColor } else { - self.unreadIndicatorView.backgroundColor = AppAssets.secondaryAccentColor + self.unreadIndicatorView.backgroundColor = AppAsset.secondaryAccentColor } } } else { if self.isHighlighted || self.isSelected { - self.unreadIndicatorView.backgroundColor = AppAssets.vibrantTextColor + self.unreadIndicatorView.backgroundColor = AppAsset.vibrantTextColor } else { - self.unreadIndicatorView.backgroundColor = AppAssets.secondaryAccentColor + self.unreadIndicatorView.backgroundColor = AppAsset.secondaryAccentColor } } } diff --git a/iOS/Timeline/TimelineUnreadCountView.swift b/iOS/Timeline/TimelineUnreadCountView.swift index 05dc23d30..6076fb650 100644 --- a/iOS/Timeline/TimelineUnreadCountView.swift +++ b/iOS/Timeline/TimelineUnreadCountView.swift @@ -27,7 +27,7 @@ final class TimelineUnreadCountView: FeedUnreadCountView { let cornerRadii = CGSize(width: cornerRadius, height: cornerRadius) let rect = CGRect(x: 1, y: 1, width: bounds.width - 2, height: bounds.height - 2) let path = UIBezierPath(roundedRect: rect, byRoundingCorners: .allCorners, cornerRadii: cornerRadii) - AppAssets.primaryAccentColor.setFill() + AppAsset.primaryAccentColor.setFill() path.fill() if unreadCount > 0 { diff --git a/iOS/Timeline/TimelineViewController.swift b/iOS/Timeline/TimelineViewController.swift index 20a76d274..e92c0b5be 100644 --- a/iOS/Timeline/TimelineViewController.swift +++ b/iOS/Timeline/TimelineViewController.swift @@ -64,7 +64,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner { // Initialize Programmatic Buttons filterButton = UIBarButtonItem(image: AppAsset.filterInactiveImage, style: .plain, target: self, action: #selector(toggleFilter(_:))) - firstUnreadButton = UIBarButtonItem(image: AppAssets.nextUnreadArticleImage, style: .plain, target: self, action: #selector(firstUnread(_:))) + firstUnreadButton = UIBarButtonItem(image: AppAsset.nextUnreadArticleImage, style: .plain, target: self, action: #selector(firstUnread(_:))) // Setup the Search Controller searchController.delegate = self @@ -264,8 +264,8 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner { completion(true) } - readAction.image = article.status.read ? AppAssets.circleClosedImage : AppAssets.circleOpenImage - readAction.backgroundColor = AppAssets.primaryAccentColor + readAction.image = article.status.read ? AppAsset.circleClosedImage : AppAsset.circleOpenImage + readAction.backgroundColor = AppAsset.primaryAccentColor return UISwipeActionsConfiguration(actions: [readAction]) } @@ -284,7 +284,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner { completion(true) } - starAction.image = article.status.starred ? AppAssets.starOpenImage : AppAssets.starClosedImage + starAction.image = article.status.starred ? AppAsset.starOpenImage : AppAsset.starClosedImage starAction.backgroundColor = AppAsset.starColor // Set up the read action @@ -334,7 +334,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner { } - moreAction.image = AppAssets.moreImage + moreAction.image = AppAsset.moreImage moreAction.backgroundColor = UIColor.systemGray return UISwipeActionsConfiguration(actions: [starAction, moreAction]) @@ -760,7 +760,7 @@ private extension TimelineViewController { let title = article.status.read ? NSLocalizedString("Mark as Unread", comment: "Mark as Unread") : NSLocalizedString("Mark as Read", comment: "Mark as Read") - let image = article.status.read ? AppAssets.circleClosedImage : AppAssets.circleOpenImage + let image = article.status.read ? AppAsset.circleClosedImage : AppAsset.circleOpenImage let action = UIAction(title: title, image: image) { [weak self] action in self?.coordinator.toggleRead(article) @@ -774,7 +774,7 @@ private extension TimelineViewController { let title = article.status.starred ? NSLocalizedString("Mark as Unstarred", comment: "Mark as Unstarred") : NSLocalizedString("Mark as Starred", comment: "Mark as Starred") - let image = article.status.starred ? AppAssets.starOpenImage : AppAssets.starClosedImage + let image = article.status.starred ? AppAsset.starOpenImage : AppAsset.starClosedImage let action = UIAction(title: title, image: image) { [weak self] action in self?.coordinator.toggleStar(article) @@ -789,7 +789,7 @@ private extension TimelineViewController { } let title = NSLocalizedString("Mark Above as Read", comment: "Mark Above as Read") - let image = AppAssets.markAboveAsReadImage + let image = AppAsset.markAboveAsReadImage let action = UIAction(title: title, image: image) { [weak self] action in MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in self?.coordinator.markAboveAsRead(article) @@ -804,7 +804,7 @@ private extension TimelineViewController { } let title = NSLocalizedString("Mark Below as Read", comment: "Mark Below as Read") - let image = AppAssets.markBelowAsReadImage + let image = AppAsset.markBelowAsReadImage let action = UIAction(title: title, image: image) { [weak self] action in MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in self?.coordinator.markBelowAsRead(article) @@ -856,7 +856,7 @@ private extension TimelineViewController { !coordinator.timelineFeedIsEqualTo(feed) else { return nil } let title = NSLocalizedString("Go to Feed", comment: "Go to Feed") - let action = UIAction(title: title, image: AppAssets.openInSidebarImage) { [weak self] action in + let action = UIAction(title: title, image: AppAsset.openInSidebarImage) { [weak self] action in self?.coordinator.discloseFeed(feed, animations: [.scroll, .navigation]) } return action @@ -934,7 +934,7 @@ private extension TimelineViewController { func copyArticleURLAction(_ article: Article) -> UIAction? { guard let url = article.preferredURL else { return nil } let title = NSLocalizedString("Copy Article URL", comment: "Copy Article URL") - let action = UIAction(title: title, image: AppAssets.copyImage) { action in + let action = UIAction(title: title, image: AppAsset.copyImage) { action in UIPasteboard.general.url = url } return action @@ -943,7 +943,7 @@ private extension TimelineViewController { func copyExternalURLAction(_ article: Article) -> UIAction? { guard let externalLink = article.externalLink, externalLink != article.preferredLink, let url = URL(string: externalLink) else { return nil } let title = NSLocalizedString("Copy External URL", comment: "Copy External URL") - let action = UIAction(title: title, image: AppAssets.copyImage) { action in + let action = UIAction(title: title, image: AppAsset.copyImage) { action in UIPasteboard.general.url = url } return action @@ -953,7 +953,7 @@ private extension TimelineViewController { func openInBrowserAction(_ article: Article) -> UIAction? { guard let _ = article.preferredURL else { return nil } let title = NSLocalizedString("Open in Browser", comment: "Open in Browser") - let action = UIAction(title: title, image: AppAssets.safariImage) { [weak self] action in + let action = UIAction(title: title, image: AppAsset.safariImage) { [weak self] action in self?.coordinator.showBrowserForArticle(article) } return action diff --git a/iOS/UIKit Extensions/InteractiveNavigationController.swift b/iOS/UIKit Extensions/InteractiveNavigationController.swift index eb939fc3d..3b1f572b0 100644 --- a/iOS/UIKit Extensions/InteractiveNavigationController.swift +++ b/iOS/UIKit Extensions/InteractiveNavigationController.swift @@ -55,12 +55,12 @@ private extension InteractiveNavigationController { scrollEdgeStandardAppearance.backgroundColor = .systemBackground navigationBar.scrollEdgeAppearance = scrollEdgeStandardAppearance - navigationBar.tintColor = AppAssets.primaryAccentColor + navigationBar.tintColor = AppAsset.primaryAccentColor let toolbarAppearance = UIToolbarAppearance() toolbar.standardAppearance = toolbarAppearance toolbar.compactAppearance = toolbarAppearance - toolbar.tintColor = AppAssets.primaryAccentColor + toolbar.tintColor = AppAsset.primaryAccentColor } } diff --git a/iOS/UIKit Extensions/VibrantButton.swift b/iOS/UIKit Extensions/VibrantButton.swift index ca2452eaa..c2b91cde2 100644 --- a/iOS/UIKit Extensions/VibrantButton.swift +++ b/iOS/UIKit Extensions/VibrantButton.swift @@ -10,7 +10,7 @@ import UIKit class VibrantButton: UIButton { - @IBInspectable var backgroundHighlightColor: UIColor = AppAssets.secondaryAccentColor + @IBInspectable var backgroundHighlightColor: UIColor = AppAsset.secondaryAccentColor override init(frame: CGRect) { super.init(frame: frame) @@ -22,8 +22,8 @@ class VibrantButton: UIButton { } private func commonInit() { - setTitleColor(AppAssets.vibrantTextColor, for: .highlighted) - let disabledColor = AppAssets.secondaryAccentColor.withAlphaComponent(0.5) + setTitleColor(AppAsset.vibrantTextColor, for: .highlighted) + let disabledColor = AppAsset.secondaryAccentColor.withAlphaComponent(0.5) setTitleColor(disabledColor, for: .disabled) } diff --git a/iOS/UIKit Extensions/VibrantLabel.swift b/iOS/UIKit Extensions/VibrantLabel.swift index 9e480a7c4..3cf515ad8 100644 --- a/iOS/UIKit Extensions/VibrantLabel.swift +++ b/iOS/UIKit Extensions/VibrantLabel.swift @@ -21,7 +21,7 @@ class VibrantLabel: UILabel { } private func commonInit() { - highlightedTextColor = AppAssets.vibrantTextColor + highlightedTextColor = AppAsset.vibrantTextColor } } diff --git a/iOS/UIKit Extensions/VibrantTableViewCell.swift b/iOS/UIKit Extensions/VibrantTableViewCell.swift index 22d74deb0..6ca29e262 100644 --- a/iOS/UIKit Extensions/VibrantTableViewCell.swift +++ b/iOS/UIKit Extensions/VibrantTableViewCell.swift @@ -13,11 +13,11 @@ class VibrantTableViewCell: UITableViewCell { static let duration: TimeInterval = 0.6 var labelColor: UIColor { - return isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label + return isHighlighted || isSelected ? AppAsset.vibrantTextColor : UIColor.label } var secondaryLabelColor: UIColor { - return isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.secondaryLabel + return isHighlighted || isSelected ? AppAsset.vibrantTextColor : UIColor.secondaryLabel } override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { @@ -47,7 +47,7 @@ class VibrantTableViewCell: UITableViewCell { /// Subclass overrides should call super func applyThemeProperties() { let selectedBackgroundView = UIView(frame: .zero) - selectedBackgroundView.backgroundColor = AppAssets.secondaryAccentColor + selectedBackgroundView.backgroundColor = AppAsset.secondaryAccentColor self.selectedBackgroundView = selectedBackgroundView } @@ -80,7 +80,7 @@ class VibrantBasicTableViewCell: VibrantTableViewCell { @IBInspectable var imageSelected: UIImage? var iconTint: UIColor { - return isHighlighted || isSelected ? labelColor : AppAssets.primaryAccentColor + return isHighlighted || isSelected ? labelColor : AppAsset.primaryAccentColor } var iconImage: UIImage? {