Continue moving to structured and shared AppAsset over separate AppAssets.

This commit is contained in:
Brent Simmons
2024-07-25 20:14:58 -07:00
parent 1660d77668
commit 440a7fbefa
36 changed files with 100 additions and 263 deletions

View File

@@ -47,8 +47,6 @@ struct AppAssets {
static let markAboveAsReadImage = UIImage(systemName: "arrowtriangle.up.circle")!
@MainActor static let folderImage = IconImage(UIImage(systemName: "folder.fill")!, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAssets.secondaryAccentColor.cgColor)
static let folderImageNonIcon = UIImage(systemName: "folder.fill")!.withRenderingMode(.alwaysOriginal).withTintColor(.secondaryLabel)
static let moreImage = UIImage(systemName: "ellipsis.circle")!
@@ -73,26 +71,22 @@ struct AppAssets {
static let sectionHeaderColor = UIColor(named: "sectionHeaderColor")!
static let shareImage = UIImage(systemName: "square.and.arrow.up")!
static let smartFeedImage = UIImage(systemName: "gear")!
static let starColor = UIColor(named: "starColor")!
static let starClosedImage = UIImage(systemName: "star.fill")!
static let starOpenImage = UIImage(systemName: "star")!
@MainActor static let starredFeedImage: IconImage = {
let image = UIImage(systemName: "star.fill")!
return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAssets.starColor.cgColor)
return IconImage(image, isSymbol: true, isBackgroundSupressed: true, preferredColor: AppAsset.starColor.cgColor)
}()
static let tickMarkColor = UIColor(named: "tickMarkColor")!
static let timelineStarImage: UIImage = {
let image = UIImage(systemName: "star.fill")!
return image.withTintColor(AppAssets.starColor, renderingMode: .alwaysOriginal)
return image.withTintColor(AppAsset.starColor, renderingMode: .alwaysOriginal)
}()
@MainActor static let todayFeedImage: IconImage = {

View File

@@ -868,7 +868,7 @@ private extension WebViewController {
func shareAction() -> UIAction {
let title = NSLocalizedString("Share", comment: "Share")
return UIAction(title: title, image: AppAssets.shareImage) { [weak self] action in
return UIAction(title: title, image: AppAsset.share) { [weak self] action in
self?.showActivityDialog()
}
}

View File

@@ -49,7 +49,7 @@ class ShareFolderPickerController: UITableViewController {
if let account = container as? ExtensionAccount {
cell.icon.image = AppAsset.Account.image(for: account.type)
} else {
cell.icon.image = AppAssets.folderImage.image
cell.icon.image = AppAsset.folder.image
}
cell.label?.text = container?.name ?? ""

View File

@@ -285,7 +285,7 @@ class TimelineViewController: UITableViewController, UndoableCommandRunner {
}
starAction.image = article.status.starred ? AppAssets.starOpenImage : AppAssets.starClosedImage
starAction.backgroundColor = AppAssets.starColor
starAction.backgroundColor = AppAsset.starColor
// Set up the read action
let moreTitle = NSLocalizedString("More", comment: "More")
@@ -984,7 +984,7 @@ private extension TimelineViewController {
func shareAction(_ article: Article, indexPath: IndexPath) -> UIAction? {
guard let url = article.preferredURL else { return nil }
let title = NSLocalizedString("Share", comment: "Share")
let action = UIAction(title: title, image: AppAssets.shareImage) { [weak self] action in
let action = UIAction(title: title, image: AppAsset.share) { [weak self] action in
self?.shareDialogForTableCell(indexPath: indexPath, url: url, title: article.title)
}
return action