Fix timeline secondary label coloring

This commit is contained in:
Maurice Parker
2019-11-04 11:47:44 -06:00
parent 524a7383ac
commit f138c2d9aa
4 changed files with 10 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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