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

@@ -13,25 +13,12 @@ class SettingsAccountTableViewCell: VibrantTableViewCell {
@IBOutlet weak var accountImage: UIImageView!
@IBOutlet weak var accountNameLabel: UILabel!
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 applyThemeProperties() {
super.applyThemeProperties()
accountNameLabel?.highlightedTextColor = AppAssets.vibrantTextColor
}
func updateVibrancy(animated: Bool) {
override func updateVibrancy(animated: Bool) {
super.updateVibrancy(animated: animated)
updateLabelVibrancy(accountNameLabel, animated: animated)
let tintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label
let duration = animated ? 0.6 : 0.0
UIView.animate(withDuration: duration) {
UIView.animate(withDuration: duration(animated: animated)) {
self.accountImage?.tintColor = tintColor
}
}