Rename AppAsset to AppImage.

This commit is contained in:
Brent Simmons
2025-01-26 22:07:13 -08:00
parent 69ae436ea4
commit b116c7b6e5
52 changed files with 240 additions and 495 deletions

View File

@@ -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)

View File

@@ -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
}()

View File

@@ -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()
}