Change disclosure triangle so that it interacts with vibrancy the same way that the unread count indicator does

This commit is contained in:
Maurice Parker 2019-10-29 19:29:37 -05:00
parent d63a743550
commit 2fa43fb1e9
1 changed files with 3 additions and 6 deletions

View File

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