From d75cab9e9a8bcf619e632a0bbff6242e97b6fbdc Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Mon, 26 Jan 2026 20:55:21 +0800 Subject: [PATCH] Restore Self.indicatorAnimationDuration --- iOS/MainTimeline/Cells/MainTimelineCell.swift | 8 +++++--- .../Cells/MainTimelineCollectionViewCell.swift | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/iOS/MainTimeline/Cells/MainTimelineCell.swift b/iOS/MainTimeline/Cells/MainTimelineCell.swift index 3627547f7..0bbc3894e 100644 --- a/iOS/MainTimeline/Cells/MainTimelineCell.swift +++ b/iOS/MainTimeline/Cells/MainTimelineCell.swift @@ -24,6 +24,8 @@ final class MainTimelineCell: UITableViewCell { var isPreview: Bool = false + private static let indicatorAnimationDuration = 0.25 + override func awakeFromNib() { MainActor.assumeIsolated { super.awakeFromNib() @@ -61,7 +63,7 @@ final class MainTimelineCell: UITableViewCell { if indicatorView.alpha == 0.0 { indicatorView.alpha = 1.0 } - UIView.animate(withDuration: 0.25) { + UIView.animate(withDuration: Self.indicatorAnimationDuration) { self.indicatorView.iconImage = Assets.Images.unreadCellIndicator self.indicatorView.tintColor = (state.isSelected && !state.isSwiped) ? .white : Assets.Colors.secondaryAccent } @@ -71,14 +73,14 @@ final class MainTimelineCell: UITableViewCell { if indicatorView.alpha == 0.0 { indicatorView.alpha = 1.0 } - UIView.animate(withDuration: 0.25) { + UIView.animate(withDuration: Self.indicatorAnimationDuration) { self.indicatorView.iconImage = Assets.Images.starredFeed self.indicatorView.tintColor = (state.isSelected && !state.isSwiped) ? .white : Assets.Colors.star } return } else if indicatorView.alpha == 1.0 { - UIView.animate(withDuration: 0.25) { + UIView.animate(withDuration: Self.indicatorAnimationDuration) { self.indicatorView.alpha = 0.0 self.indicatorView.iconImage = nil } diff --git a/iOS/MainTimeline/Cells/MainTimelineCollectionViewCell.swift b/iOS/MainTimeline/Cells/MainTimelineCollectionViewCell.swift index 145152461..c2c59a9d1 100644 --- a/iOS/MainTimeline/Cells/MainTimelineCollectionViewCell.swift +++ b/iOS/MainTimeline/Cells/MainTimelineCollectionViewCell.swift @@ -25,6 +25,8 @@ class MainTimelineCollectionViewCell: UICollectionViewCell { var isPreview: Bool = false + private static let indicatorAnimationDuration = 0.25 + override func awakeFromNib() { MainActor.assumeIsolated { super.awakeFromNib() @@ -62,7 +64,7 @@ class MainTimelineCollectionViewCell: UICollectionViewCell { if indicatorView.alpha == 0.0 { indicatorView.alpha = 1.0 } - UIView.animate(withDuration: 0.25) { + UIView.animate(withDuration: Self.indicatorAnimationDuration) { self.indicatorView.iconImage = Assets.Images.unreadCellIndicator self.indicatorView.tintColor = (state.isSelected && !state.isSwiped) ? .white : Assets.Colors.secondaryAccent } @@ -72,14 +74,14 @@ class MainTimelineCollectionViewCell: UICollectionViewCell { if indicatorView.alpha == 0.0 { indicatorView.alpha = 1.0 } - UIView.animate(withDuration: 0.25) { + UIView.animate(withDuration: Self.indicatorAnimationDuration) { self.indicatorView.iconImage = Assets.Images.starredFeed self.indicatorView.tintColor = (state.isSelected && !state.isSwiped) ? .white : Assets.Colors.star } return } else if indicatorView.alpha == 1.0 { - UIView.animate(withDuration: 0.25) { + UIView.animate(withDuration: Self.indicatorAnimationDuration) { self.indicatorView.alpha = 0.0 self.indicatorView.iconImage = nil }