From f138c2d9aabd4e7b7fd68119f942aa091b30e1a7 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 4 Nov 2019 11:47:44 -0600 Subject: [PATCH] Fix timeline secondary label coloring --- iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift | 2 +- iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift | 8 ++++---- iOS/Settings/SettingsAccountTableViewCell.swift | 2 +- iOS/UIKit Extensions/VibrantTableViewCell.swift | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift index ff5d48a6d..3483bf17d 100644 --- a/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift +++ b/iOS/MasterFeed/Cell/MasterFeedTableViewCell.swift @@ -158,7 +158,7 @@ class MasterFeedTableViewCell : VibrantTableViewCell { UIView.animate(withDuration: duration(animated: animated)) { self.avatarView.tintColor = avatarTintColor } - updateLabelVibrancy(titleView, animated: animated) + updateLabelVibrancy(titleView, color: labelColor, animated: animated) } } diff --git a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift index 926a009a2..16f0c6ca5 100644 --- a/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift +++ b/iOS/MasterTimeline/Cell/MasterTimelineTableViewCell.swift @@ -41,10 +41,10 @@ class MasterTimelineTableViewCell: VibrantTableViewCell { } override func updateVibrancy(animated: Bool) { - updateLabelVibrancy(titleView, animated: animated) - updateLabelVibrancy(summaryView, animated: animated) - updateLabelVibrancy(dateView, animated: animated) - updateLabelVibrancy(feedNameView, animated: animated) + updateLabelVibrancy(titleView, color: labelColor, animated: animated) + updateLabelVibrancy(summaryView, color: labelColor, animated: animated) + updateLabelVibrancy(dateView, color: secondaryLabelColor, animated: animated) + updateLabelVibrancy(feedNameView, color: secondaryLabelColor, animated: animated) UIView.animate(withDuration: duration(animated: animated)) { if self.isHighlighted || self.isSelected { diff --git a/iOS/Settings/SettingsAccountTableViewCell.swift b/iOS/Settings/SettingsAccountTableViewCell.swift index d958b5087..2d5ba352d 100644 --- a/iOS/Settings/SettingsAccountTableViewCell.swift +++ b/iOS/Settings/SettingsAccountTableViewCell.swift @@ -15,7 +15,7 @@ class SettingsAccountTableViewCell: VibrantTableViewCell { override func updateVibrancy(animated: Bool) { super.updateVibrancy(animated: animated) - updateLabelVibrancy(accountNameLabel, animated: animated) + updateLabelVibrancy(accountNameLabel, color: labelColor, animated: animated) let tintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label UIView.animate(withDuration: duration(animated: animated)) { diff --git a/iOS/UIKit Extensions/VibrantTableViewCell.swift b/iOS/UIKit Extensions/VibrantTableViewCell.swift index 04699b7d2..4c3a7c27d 100644 --- a/iOS/UIKit Extensions/VibrantTableViewCell.swift +++ b/iOS/UIKit Extensions/VibrantTableViewCell.swift @@ -51,18 +51,18 @@ class VibrantTableViewCell: UITableViewCell { /// Subclass overrides should call super func updateVibrancy(animated: Bool) { - updateLabelVibrancy(textLabel, animated: animated) - updateLabelVibrancy(detailTextLabel, animated: animated) + updateLabelVibrancy(textLabel, color: labelColor, animated: animated) + updateLabelVibrancy(detailTextLabel, color: labelColor, animated: animated) } func duration(animated: Bool) -> TimeInterval { return animated ? 0.6 : 0.0 } - func updateLabelVibrancy(_ label: UILabel?, animated: Bool) { + func updateLabelVibrancy(_ label: UILabel?, color: UIColor, animated: Bool) { guard let label = label else { return } UIView.transition(with: label, duration: duration(animated: animated), options: .transitionCrossDissolve, animations: { - label.textColor = self.labelColor + label.textColor = color }, completion: nil) }