Update label animations to match cell selection fading and changed table animation speeds to 1.5. Issue #1237

This commit is contained in:
Maurice Parker
2019-11-02 19:57:01 -05:00
parent fd1eb77d88
commit 8fb87a7c87
11 changed files with 97 additions and 100 deletions

View File

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

View File

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