mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Rename AppAsset to AppImage.
This commit is contained in:
@@ -57,7 +57,7 @@ final class CloudKitAccountViewController: UITableViewController {
|
||||
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
||||
if section == 0 {
|
||||
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
|
||||
headerView.imageView.image = AppAsset.image(accountType: .cloudKit)
|
||||
headerView.imageView.image = AppImage.accountImage(.cloudKit)
|
||||
return headerView
|
||||
} else {
|
||||
return super.tableView(tableView, viewForHeaderInSection: section)
|
||||
|
||||
@@ -59,7 +59,7 @@ final class FeedbinAccountViewController: UITableViewController {
|
||||
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
||||
if section == 0 {
|
||||
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
|
||||
headerView.imageView.image = AppAsset.image(accountType: .feedbin)
|
||||
headerView.imageView.image = AppImage.accountImage(.feedbin)
|
||||
return headerView
|
||||
} else {
|
||||
return super.tableView(tableView, viewForHeaderInSection: section)
|
||||
|
||||
@@ -46,7 +46,7 @@ final class LocalAccountViewController: UITableViewController {
|
||||
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
||||
if section == 0 {
|
||||
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
|
||||
headerView.imageView.image = AppAsset.image(accountType: .onMyMac)
|
||||
headerView.imageView.image = AppImage.accountImage(.onMyMac)
|
||||
return headerView
|
||||
} else {
|
||||
return super.tableView(tableView, viewForHeaderInSection: section)
|
||||
|
||||
@@ -58,7 +58,7 @@ final class NewsBlurAccountViewController: UITableViewController {
|
||||
override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
|
||||
if section == 0 {
|
||||
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
|
||||
headerView.imageView.image = AppAsset.image(accountType: .newsBlur)
|
||||
headerView.imageView.image = AppImage.accountImage(.newsBlur)
|
||||
return headerView
|
||||
} else {
|
||||
return super.tableView(tableView, viewForHeaderInSection: section)
|
||||
|
||||
@@ -210,13 +210,13 @@ final class ReaderAPIAccountViewController: UITableViewController {
|
||||
if let accountType = accountType {
|
||||
switch accountType {
|
||||
case .bazQux:
|
||||
return AppAsset.image(accountType: .bazQux)
|
||||
return AppImage.accountImage(.bazQux)
|
||||
case .inoreader:
|
||||
return AppAsset.image(accountType: .inoreader)
|
||||
return AppImage.accountImage(.inoreader)
|
||||
case .theOldReader:
|
||||
return AppAsset.image(accountType: .theOldReader)
|
||||
return AppImage.accountImage(.theOldReader)
|
||||
case .freshRSS:
|
||||
return AppAsset.image(accountType: .freshRSS)
|
||||
return AppImage.accountImage(.freshRSS)
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -53,35 +53,35 @@ struct AppAssets {
|
||||
|
||||
// static let nnwFeedIcon = RSImage(named: "nnwFeedIcon")!
|
||||
|
||||
static var articleExtractorError: UIImage = {
|
||||
return UIImage(named: "articleExtractorError")!
|
||||
}()
|
||||
|
||||
static var articleExtractorOff: UIImage = {
|
||||
return UIImage(named: "articleExtractorOff")!
|
||||
}()
|
||||
|
||||
static var articleExtractorOffSF: UIImage = {
|
||||
return UIImage(systemName: "doc.plaintext")!
|
||||
}()
|
||||
|
||||
static var articleExtractorOffTinted: UIImage = {
|
||||
let image = UIImage(named: "articleExtractorOff")!
|
||||
return image.tinted(color: AppAssets.primaryAccentColor)!
|
||||
}()
|
||||
|
||||
static var articleExtractorOn: UIImage = {
|
||||
return UIImage(named: "articleExtractorOn")!
|
||||
}()
|
||||
|
||||
static var articleExtractorOnSF: UIImage = {
|
||||
return UIImage(named: "articleExtractorOnSF")!
|
||||
}()
|
||||
|
||||
static var articleExtractorOnTinted: UIImage = {
|
||||
let image = UIImage(named: "articleExtractorOn")!
|
||||
return image.tinted(color: AppAssets.primaryAccentColor)!
|
||||
}()
|
||||
// static var articleExtractorError: UIImage = {
|
||||
// return UIImage(named: "articleExtractorError")!
|
||||
// }()
|
||||
//
|
||||
// static var articleExtractorOff: UIImage = {
|
||||
// return UIImage(named: "articleExtractorOff")!
|
||||
// }()
|
||||
//
|
||||
// static var articleExtractorOffSF: UIImage = {
|
||||
// return UIImage(systemName: "doc.plaintext")!
|
||||
// }()
|
||||
//
|
||||
// static var articleExtractorOffTinted: UIImage = {
|
||||
// let image = UIImage(named: "articleExtractorOff")!
|
||||
// return image.tinted(color: AppAssets.primaryAccentColor)!
|
||||
// }()
|
||||
//
|
||||
// static var articleExtractorOn: UIImage = {
|
||||
// return UIImage(named: "articleExtractorOn")!
|
||||
// }()
|
||||
//
|
||||
// static var articleExtractorOnSF: UIImage = {
|
||||
// return UIImage(named: "articleExtractorOnSF")!
|
||||
// }()
|
||||
//
|
||||
// static var articleExtractorOnTinted: UIImage = {
|
||||
// let image = UIImage(named: "articleExtractorOn")!
|
||||
// return image.tinted(color: AppAssets.primaryAccentColor)!
|
||||
// }()
|
||||
|
||||
static var iconBackgroundColor: UIColor = {
|
||||
return UIColor(named: "iconBackgroundColor")!
|
||||
@@ -135,9 +135,9 @@ struct AppAssets {
|
||||
UIImage(systemName: "info.circle")!
|
||||
}()
|
||||
|
||||
static var markAllAsReadImage: UIImage = {
|
||||
return UIImage(named: "markAllAsRead")!
|
||||
}()
|
||||
// static var markAllAsReadImage: UIImage = {
|
||||
// return UIImage(named: "markAllAsRead")!
|
||||
// }()
|
||||
|
||||
static var markBelowAsReadImage: UIImage = {
|
||||
return UIImage(systemName: "arrowtriangle.down.circle")!
|
||||
|
||||
@@ -25,16 +25,16 @@ final class ArticleExtractorButton: UIButton {
|
||||
switch buttonState {
|
||||
case .error:
|
||||
stripAnimatedSublayer()
|
||||
setImage(AppAssets.articleExtractorError, for: .normal)
|
||||
setImage(AppImage.articleExtractorError, for: .normal)
|
||||
case .animated:
|
||||
setImage(nil, for: .normal)
|
||||
setNeedsLayout()
|
||||
case .on:
|
||||
stripAnimatedSublayer()
|
||||
setImage(AppAssets.articleExtractorOn, for: .normal)
|
||||
setImage(AppImage.articleExtractorOn, for: .normal)
|
||||
case .off:
|
||||
stripAnimatedSublayer()
|
||||
setImage(AppAssets.articleExtractorOff, for: .normal)
|
||||
setImage(AppImage.articleExtractorOff, for: .normal)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,12 +72,12 @@ final class ArticleExtractorButton: UIButton {
|
||||
}
|
||||
|
||||
private func addAnimatedSublayer(to hostedLayer: CALayer) {
|
||||
let image1 = AppAssets.articleExtractorOffTinted.cgImage!
|
||||
let image2 = AppAssets.articleExtractorOnTinted.cgImage!
|
||||
let image1 = AppImage.articleExtractorOffTinted.cgImage!
|
||||
let image2 = AppImage.articleExtractorOnTinted.cgImage!
|
||||
let images = [image1, image2, image1]
|
||||
|
||||
animatedLayer = CALayer()
|
||||
let imageSize = AppAssets.articleExtractorOff.size
|
||||
let imageSize = AppImage.articleExtractorOff.size
|
||||
animatedLayer!.bounds = CGRect(x: 0, y: 0, width: imageSize.width, height: imageSize.height)
|
||||
animatedLayer!.position = CGPoint(x: bounds.midX, y: bounds.midY)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ final class ArticleViewController: UIViewController {
|
||||
private var articleExtractorButton: ArticleExtractorButton = {
|
||||
let button = ArticleExtractorButton(type: .system)
|
||||
button.frame = CGRect(x: 0, y: 0, width: 44.0, height: 44.0)
|
||||
button.setImage(AppAssets.articleExtractorOff, for: .normal)
|
||||
button.setImage(AppImage.articleExtractorOff, for: .normal)
|
||||
return button
|
||||
}()
|
||||
|
||||
|
||||
@@ -768,7 +768,7 @@ private extension WebViewController {
|
||||
func toggleArticleExtractorAction() -> UIAction {
|
||||
let extracted = articleExtractorButtonState == .on
|
||||
let title = extracted ? NSLocalizedString("Show Feed Article", comment: "Show Feed Article") : NSLocalizedString("Show Reader View", comment: "Show Reader View")
|
||||
let extractorImage = extracted ? AppAssets.articleExtractorOffSF : AppAssets.articleExtractorOnSF
|
||||
let extractorImage = extracted ? AppImage.articleExtractorOffSF : AppImage.articleExtractorOnSF
|
||||
return UIAction(title: title, image: extractorImage) { [weak self] _ in
|
||||
self?.toggleArticleExtractor()
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ extension AccountInspectorViewController {
|
||||
|
||||
if section == 0 {
|
||||
let headerView = tableView.dequeueReusableHeaderFooterView(withIdentifier: "SectionHeader") as! ImageHeaderView
|
||||
headerView.imageView.image = AppAsset.image(accountType: account.type)
|
||||
headerView.imageView.image = AppImage.accountImage(account.type)
|
||||
return headerView
|
||||
} else {
|
||||
return super.tableView(tableView, viewForHeaderInSection: section)
|
||||
|
||||
@@ -1145,7 +1145,7 @@ private extension MainFeedViewController {
|
||||
|
||||
let localizedMenuText = NSLocalizedString("Mark All as Read in “%@”", comment: "Command")
|
||||
let title = NSString.localizedStringWithFormat(localizedMenuText as NSString, feed.nameForDisplay) as String
|
||||
let action = UIAction(title: title, image: AppAssets.markAllAsReadImage) { [weak self] _ in
|
||||
let action = UIAction(title: title, image: AppImage.markAllAsRead) { [weak self] _ in
|
||||
MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in
|
||||
if let articles = try? feed.fetchUnreadArticles() {
|
||||
self?.coordinator.markAllAsRead(Array(articles))
|
||||
@@ -1163,7 +1163,7 @@ private extension MainFeedViewController {
|
||||
|
||||
let localizedMenuText = NSLocalizedString("Mark All as Read in “%@”", comment: "Command")
|
||||
let title = NSString.localizedStringWithFormat(localizedMenuText as NSString, account.nameForDisplay) as String
|
||||
let action = UIAction(title: title, image: AppAssets.markAllAsReadImage) { [weak self] _ in
|
||||
let action = UIAction(title: title, image: AppImage.markAllAsRead) { [weak self] _ in
|
||||
MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in
|
||||
// If you don't have this delay the screen flashes when it executes this code
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
|
||||
@@ -919,7 +919,7 @@ private extension TimelineViewController {
|
||||
let localizedMenuText = NSLocalizedString("Mark All as Read in “%@”", comment: "Command")
|
||||
let title = NSString.localizedStringWithFormat(localizedMenuText as NSString, feed.nameForDisplay) as String
|
||||
|
||||
let action = UIAction(title: title, image: AppAssets.markAllAsReadImage) { [weak self] _ in
|
||||
let action = UIAction(title: title, image: AppImage.markAllAsRead) { [weak self] _ in
|
||||
MarkAsReadAlertController.confirm(self, coordinator: self?.coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in
|
||||
self?.coordinator.markAllAsRead(articles)
|
||||
}
|
||||
|
||||
@@ -127,17 +127,17 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe
|
||||
switch indexPath.section {
|
||||
case AddAccountSections.local.rawValue:
|
||||
cell.comboNameLabel?.text = AddAccountSections.local.sectionContent[indexPath.row].localizedAccountName()
|
||||
cell.comboImage?.image = AppAsset.image(accountType: .onMyMac)
|
||||
cell.comboImage?.image = AppImage.accountImage(.onMyMac)
|
||||
case AddAccountSections.icloud.rawValue:
|
||||
cell.comboNameLabel?.text = AddAccountSections.icloud.sectionContent[indexPath.row].localizedAccountName()
|
||||
cell.comboImage?.image = AppAsset.image(accountType: AddAccountSections.icloud.sectionContent[indexPath.row])
|
||||
cell.comboImage?.image = AppImage.accountImage(AddAccountSections.icloud.sectionContent[indexPath.row])
|
||||
if AppDefaults.isDeveloperBuild || AccountManager.shared.accounts.contains(where: { $0.type == .cloudKit }) {
|
||||
cell.isUserInteractionEnabled = false
|
||||
cell.comboNameLabel?.isEnabled = false
|
||||
}
|
||||
case AddAccountSections.web.rawValue:
|
||||
cell.comboNameLabel?.text = AddAccountSections.web.sectionContent[indexPath.row].localizedAccountName()
|
||||
cell.comboImage?.image = AppAsset.image(accountType: AddAccountSections.web.sectionContent[indexPath.row])
|
||||
cell.comboImage?.image = AppImage.accountImage(AddAccountSections.web.sectionContent[indexPath.row])
|
||||
let type = AddAccountSections.web.sectionContent[indexPath.row]
|
||||
if (type == .feedly || type == .inoreader) && AppDefaults.isDeveloperBuild {
|
||||
cell.isUserInteractionEnabled = false
|
||||
@@ -145,7 +145,7 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe
|
||||
}
|
||||
case AddAccountSections.selfhosted.rawValue:
|
||||
cell.comboNameLabel?.text = AddAccountSections.selfhosted.sectionContent[indexPath.row].localizedAccountName()
|
||||
cell.comboImage?.image = AppAsset.image(accountType: AddAccountSections.selfhosted.sectionContent[indexPath.row])
|
||||
cell.comboImage?.image = AppImage.accountImage(AddAccountSections.selfhosted.sectionContent[indexPath.row])
|
||||
|
||||
default:
|
||||
return cell
|
||||
|
||||
@@ -121,7 +121,7 @@ final class SettingsViewController: UITableViewController {
|
||||
let acctCell = tableView.dequeueReusableCell(withIdentifier: "SettingsComboTableViewCell", for: indexPath) as! SettingsComboTableViewCell
|
||||
acctCell.applyThemeProperties()
|
||||
let account = sortedAccounts[indexPath.row]
|
||||
acctCell.comboImage?.image = AppAsset.image(accountType: account.type)
|
||||
acctCell.comboImage?.image = AppImage.accountImage(account.type)
|
||||
acctCell.comboNameLabel?.text = account.nameForDisplay
|
||||
cell = acctCell
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ final class ShareFolderPickerController: UITableViewController {
|
||||
}()
|
||||
|
||||
if let account = container as? ExtensionAccount {
|
||||
cell.icon.image = AppAsset.image(accountType: account.type)
|
||||
cell.icon.image = AppImage.accountImage(account.type)
|
||||
} else {
|
||||
cell.icon.image = AppAssets.folderImage.image
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user