2019-10-23 17:35:53 +02:00
|
|
|
//
|
|
|
|
// SettingsAccountTableViewCell.swift
|
|
|
|
// NetNewsWire-iOS
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 10/23/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
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)
|
2019-10-23 18:47:21 +02:00
|
|
|
updateVibrancy(animated: animated)
|
2019-10-23 17:35:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
|
|
super.setSelected(selected, animated: animated)
|
2019-10-23 18:47:21 +02:00
|
|
|
updateVibrancy(animated: animated)
|
|
|
|
}
|
|
|
|
|
|
|
|
override func applyThemeProperties() {
|
|
|
|
super.applyThemeProperties()
|
|
|
|
accountNameLabel?.highlightedTextColor = AppAssets.vibrantTextColor
|
|
|
|
}
|
|
|
|
|
|
|
|
func updateVibrancy(animated: Bool) {
|
2019-10-23 17:35:53 +02:00
|
|
|
let tintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : UIColor.label
|
2019-10-23 18:56:36 +02:00
|
|
|
let duration = animated ? 0.6 : 0.0
|
2019-10-23 18:47:21 +02:00
|
|
|
UIView.animate(withDuration: duration) {
|
|
|
|
self.accountImage?.tintColor = tintColor
|
|
|
|
}
|
2019-10-23 17:35:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|