mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Update label animations to match cell selection fading and changed table animation speeds to 1.5. Issue #1237
This commit is contained in:
@@ -127,19 +127,8 @@ class MasterFeedTableViewCell : VibrantTableViewCell {
|
||||
|
||||
override func applyThemeProperties() {
|
||||
super.applyThemeProperties()
|
||||
titleView.highlightedTextColor = AppAssets.vibrantTextColor
|
||||
}
|
||||
|
||||
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
|
||||
super.setHighlighted(highlighted, animated: animated)
|
||||
updateVibrancy(animated: animated)
|
||||
}
|
||||
|
||||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
updateVibrancy(animated: animated)
|
||||
}
|
||||
|
||||
override func willTransition(to state: UITableViewCell.StateMask) {
|
||||
super.willTransition(to: state)
|
||||
isShowingEditControl = state.contains(.showingEditControl)
|
||||
@@ -163,6 +152,15 @@ class MasterFeedTableViewCell : VibrantTableViewCell {
|
||||
}
|
||||
}
|
||||
|
||||
override func updateVibrancy(animated: Bool) {
|
||||
super.updateVibrancy(animated: animated)
|
||||
let avatarTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor
|
||||
UIView.animate(withDuration: duration(animated: animated)) {
|
||||
self.avatarView.tintColor = avatarTintColor
|
||||
}
|
||||
updateLabelVibrancy(titleView, animated: animated)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private extension MasterFeedTableViewCell {
|
||||
@@ -199,14 +197,6 @@ private extension MasterFeedTableViewCell {
|
||||
bottomSeparatorView.setFrameIfNotEqual(layout.separatorRect)
|
||||
}
|
||||
|
||||
func updateVibrancy(animated: Bool) {
|
||||
let avatarTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor
|
||||
let duration = animated ? 0.6 : 0.0
|
||||
UIView.animate(withDuration: duration) {
|
||||
self.avatarView.tintColor = avatarTintColor
|
||||
}
|
||||
}
|
||||
|
||||
func hideView(_ view: UIView) {
|
||||
if !view.isHidden {
|
||||
view.isHidden = true
|
||||
|
||||
@@ -75,7 +75,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
tableView.layer.speed = 2.0
|
||||
tableView.layer.speed = AppAssets.layerSpeed
|
||||
}
|
||||
|
||||
// MARK: Notifications
|
||||
|
||||
Reference in New Issue
Block a user