Change disclosure triangle so that it interacts with vibrancy the same way that the unread count indicator does
This commit is contained in:
parent
d63a743550
commit
2fa43fb1e9
|
@ -178,6 +178,7 @@ private extension MasterFeedTableViewCell {
|
||||||
disclosureButton = NonIntrinsicButton(type: .roundedRect)
|
disclosureButton = NonIntrinsicButton(type: .roundedRect)
|
||||||
disclosureButton!.addTarget(self, action: #selector(buttonPressed(_:)), for: UIControl.Event.touchUpInside)
|
disclosureButton!.addTarget(self, action: #selector(buttonPressed(_:)), for: UIControl.Event.touchUpInside)
|
||||||
disclosureButton?.setImage(AppAssets.disclosureImage, for: .normal)
|
disclosureButton?.setImage(AppAssets.disclosureImage, for: .normal)
|
||||||
|
disclosureButton?.tintColor = AppAssets.controlBackgroundColor
|
||||||
disclosureButton?.imageView?.contentMode = .center
|
disclosureButton?.imageView?.contentMode = .center
|
||||||
disclosureButton?.imageView?.clipsToBounds = false
|
disclosureButton?.imageView?.clipsToBounds = false
|
||||||
addSubviewAtInit(disclosureButton!)
|
addSubviewAtInit(disclosureButton!)
|
||||||
|
@ -198,14 +199,10 @@ private extension MasterFeedTableViewCell {
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateVibrancy(animated: Bool) {
|
func updateVibrancy(animated: Bool) {
|
||||||
let faviconTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor
|
let avatarTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.secondaryAccentColor
|
||||||
let disclosureTintColor = isHighlighted || isSelected ? AppAssets.vibrantTextColor : AppAssets.controlBackgroundColor
|
|
||||||
|
|
||||||
let duration = animated ? 0.6 : 0.0
|
let duration = animated ? 0.6 : 0.0
|
||||||
|
|
||||||
UIView.animate(withDuration: duration) {
|
UIView.animate(withDuration: duration) {
|
||||||
self.disclosureButton?.tintColor = disclosureTintColor
|
self.avatarView.tintColor = avatarTintColor
|
||||||
self.avatarView.tintColor = faviconTintColor
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue